To make sure that you win a skirmish you just have to be efficient. Do things which cost him more population than you. At the end he goes out of population while you still have units and resources to defeat him, but he cant do anything.