Archery is all fun and games until you get run down by cavalry.
Cavalry can be defeated with pointy sticks.

If the cost of producing and maintaining the force is also a factor though, surely the logistical demand of cavalry is an order of magnitude greater than that of either archers or crossbowmen?

And then, as the other fella said, pointy sticks.

Babylonians: not a problem