This is all about the circumstances under which you're fighting. One L2 militia is 3.2-4.8 on infantry targets and 20 HP, 2xL1 infantry are 6.0-9.0 and 30 HP so they're obviously stronger. However, both are defensive units; when the infantry is attacking, they hit 6.0 while the militia hits 4.8 back which isn't a very big advantage. If this happens in forest or hills, where militia has more combat bonuses, that goes to zero and the infantry only has the HP advantage. Now if there's anything else in play (a doctrine advantage; some slight previous damage to the infantry; etc). they don't even win anymore.
Now take a step back. You have the numerical advantage, but that's really all you have. You're using defensive units to attack, against an enemy who is also better at defending. They're inferior tech level. They are slightly understrength. They come to terrain that favors the enemy. How on EARTH would you expect them to win?!