It had to be overarm.
Underarm is more versatile, but it makes no sense in phalanx fights.
As we all know, hoplites fought in shield-wall formations and when two sides clashed their front rows were supported by a huge mass of soldiers behind them, pushing them forward. In such scenarios there is simply no space for underarm fighting style. You would not be able to move you elbows. Even if you could, wounding your enemy would be extremely hard, since he would be standing in your face with his shield for cover.
The only option is thrusting down at your enemy's upper body while his shields is pinned against yours. And that's overarm.
Also for some reason my overarm thrust has more force than underarm (usually the opposite for most folks), but less control (as expected).