I don't think it's necessarily due to AI. I've experimented quite a bit this afternoon with (mostly sturigan) infantry and archers in custom battles. The thing is: If a perfect line of infantry marches towards a perfect line of archers, and you time your shield wall/charge right, infantry will win.
But as soon as your formation is disturbed even a little bit, archers will win. I think a big reason for this is that infantry is by far the most reliable on positioning. If a ranged unit is far away from the enemy, it can just keep shooting. If a cavalry unit is far away from an enemy, it can charge. But an infantry unit that is not directly in front of an enemy is pointless.
You can use this e.g. in the following way: Split your archers into two groups, have them stand apart. Infantry will advance towards one of them. Have that one fall back while the other one flanks. If the infantry switches targets, switch the groups. With this you can win 20 v 60 battles. I guess to some degree this is abuse of AI, but the deeper problem is: One infantryman can cover himself, but as soon as 2 infantrymen want to attack 2 archers on different sides of the battlefield, it is basically impossible for them to avoid getting shot in the back by one of those. Ranged units would IMO need to be much more vulnerable in melee to make up for the huge tactical advantage this gives you on any larger battlefield.