Yeah quite a few people do this online (gah, annoying! :P), especially in team games where you can merge multiple armies together. You can beat it by focusing on purely one area of the square, when that part of box is crumbling the guy has to dismantle the box to reinforce the area that's crumbling, then the box is has holes and cavalry and such can thrust through holes into the backs of phalanxes.
But versus AI, it's harder to lose with the box formation than to win with it ;)