You also need to think of the psychological side.
A general rule of thumb is that a human army will break when it loses about a third of it's number. So even if they have 'won' 10,000 to 3000 in casualties, that might be enough for the remaining humans to break for it (and rapidly get overwhelmed).
There is also the impact of them not dying. You shoot them with an arrow - they keep coming. You chop an arm off - it keeps attacking. You've cut it's legs off - now it's going for your legs whilst the next two are jumping on your shield. They have no fear and no sense of injury. So your line breaks; those in the rear echelons get spooked and start running, soon it's every man for himself.
Yes, if the defenders could stand in line, methodically chop off heads and ignore their own casualties they would probably win - but battles are not like that.
With additions as suggested..
Looking at various tactics:
Cavalry:
Having a crowd of large horses with armored knights on them is a terrifying spectacle, if it is directed at you. Of course, the zombies feel no fear. Run them through with a spear, and you've just lost your spear. Hack with a sword and you might do some damage, but taking a head requires serious skill. 358
Stop to fight at bay, and the mob will close in. Lose the horse, and you'll be stumbling around half-blind in heavy armor whilst zombies dogpile you. Would you charge a horde of zombies knowing that death is almost certain?
Archer:
Look I made a pincushion. Time to leg it now.
Cannon:
Look I played skittles. Skittles getting back up. Tile to leg it even more..
Shieldwall:
In which your first rank have swords; second and third ranks have spears that protrude.
The whole point of the shieldwall is that it's meant to be safe, that's what allows people to go into combat (most people worry about dying, and a solid formation makes it harder to slope off), and it's hard to attack because the first attackers get skewered. But the zombies don't care - the first ones charge straight onto any spears, without dying, dragging them down. The next wave are onto the swordsmen, and even if you do kill them, sheer weight of numbers will overbear you, as above.
The majority of deaths in medieval battles happen in the rout, when your formation breaks up and starts to flee. Once chaos starts, the zombies have all the advantages. Every time they stab someone, break a limb, or stun an opponent they've knocked that person out of the fight; knocking them out requires serious dismemberment. 358