5-1 with crap troops would be impossible even if your enemy didn't issue order and just stood there, letting you triple encircle each unit individually.
Well.. No. I ran a quick custom battle of 2 town watch + 1 hastati (did not use their pilas to simulate a warband) against 5 warbands (1200 people).
here is the battle replay.Now if they had two rams, i would place my hastati closer to the gate, so that it is
OPEN. An invitation if you want to call it so.
If They wouldn't use it, i would have to focus on one of the entrances, wipe out (smaller) amount of their troops, and run outside. Just like we did in Spain LP using the bridge when we were surrounded.
Eventually a charge would be in order, to force them to chase us through the gate.
It's important to keep blowing the horn, so that our morale will be this tiny bit higher than theirs.
With a merc warband it would be slightly different than hastati. First of all, i would have them charge after warcry, which would quicken the morale break (easier)
But their out-of-warcry morale is lower. Thus there is more of a gamble. You'd have to coordinate a tri-charge in the perfect moment to bring enemies to wavering ASAP, and start a chain-rout before your advantage (warcry) is out.
Edit : Right. In case you can not view battle replay.
They will start will many casualties, and go to shaken right away, perhaps even wavering.
They will keep pushing though, and nearly break our line. Keep blowing the horn, stand ze ground, try having as many of your troops attacking as possible.
It won' be long, untill...
We won't chase them too far, as They will come back soon. Back to starting positions.
Repeat 4 times, then :
Our morale stayed at stable for the most part, sometimes even eager. Against barbarians : Morale wins/.
The only gamble is warcry. For 30 seconds after warcry troop morale is extremely high. You may have to hold that long.