Here's an example of Phalanx Vs Urban Cohort battle. (I choosed spartans cause they're equal in number with Urbans [in Huge unit scale option they are 81vs83] and also they're stronger than other phalanxes.) Note that these are taken from an unpatched, Vanilla RTW.
Time for Formation.
Phalanx Formation and Defensive Mode Unselected, Units are set to Loose Formation.
They're set to form Phalanx again.
The battle begins. Romans marches forward, while Spartans hold their position.
This is a good distance. Now Spartans can also move forward and attack. Romans will soon throw javelins. Spartans shouldn't stand and wait, cause if they do, Romans will have time to throw Javelins for a second time. (The first ones though, are unavoidable.)
Contact. Romans throws javelins, luckly they miss, now the forces are matched evenly when the real fight begins.
Battle goes on, Since Urbans lost their advantage when they miss Spartans and they both start in equal numbers, Spartans attacks at full force, Right now as can be seen Urbans have 47 soldier while Spartans have 66. Urbans failed to break through Phalanx line.
Both Generals lies dead. Spartans returns to Tight Formation and while gaining quite advantage in defence they also causes heavy casualty to their foes, They left Urbans with 14 soldiers while Spartans still have 39.
Urbans routs! Spartans has 32 soldiers and the last remaining Roman desperately runs away.
"Run for the hills!" he yells, though in Grassy Flatland there are no hills nearby. Spartans charges to slay their last remaining foe.
Here's my result.