It's hard to understand what the game considers as heroic victory. As far as I know, you only get one when you are outnumbered and the enemy's losses are way more than yours. From your battle, I think the AI also takes into account your troop types though I might be wrong. Still, great job for you!
I was actually lucky, sort of. After I repulsed the first three enemy armies, the last one just had one unit waiting at the edge of the map doing nothing. Perhaps a bug. I knew if I left my castle defenses to attack it, its reinforcements might appear and overpower my badly depleted troops. So I left it and waited for the timer to run out.
Overall, it was still a very tough fight because the enemy army had vastly superior numbers of archers. I had to use my limited cavalry units very carefully to keep as many alive as possible for taking out their archers. I left my men in loose formation to lessen my losses from arrows until the enemy scaled the walls, then switched to tight. I also sent my cavalry out the back door to eliminate isolated enemy archers. Once most of the enemy melee infantry had been taken care of, I sallied my men to mop up their archers and the battle was pretty much won by then. It's always a good idea to harass the enemy archers or do hit and runs on them with your cavalry to disrupt their attacks on your defending troops. If they send their spears against your cavalry, pull back and lure them into your archer fire from the walls. This works well as long as your ammo does not run out.
[This message has been edited by Genghis_Khan1 (edited 01-23-2012 @ 12:35 PM).]