1 Spearman with 25% fortification and +10% Combat I and +20% city defence being attacked by a chariot.
4 * (1 + .25 + .1 + .2 + 1) = 4 * (2.55) = 10.2
1 archer with 25% fortification, +20% city, +20% city defence being attacked by a chariot.
3 * (1 + .5 + .25 + .2 + .2) = 3 * 2.15 = 6.45
Using ^1.4 as a conservative power curve, we get 1 spearman is worth 1.9 archers defending against chariots.
Axes vs Axes:
5 * (1 + .25 + .1 + .2) = 5 * 1.55 = 7.75
Axes vs Archers:
3 * (1 + .5 + .25 + .2 + .2) = 6.45
1 Axe is worth 1.3 Archers defending against Axes.
Axes vs Spearmen:
.25 + .1 + .2 - 1 = -.45
4 / (1.45) = 2.76
One Spearman is worth 0.3 archers against axes.
Chariots vs Axes
.25 + .1 + .2 - 1 = -.45
5 / (1.45) = 3.45
One Axe is worth 0.4 archers against chariots.
So 10 spearmen (19 archers vs chariots) plus 15 axemen (6 archers vs chariots) is 25 archers vs chariots.
It is also 22.5 archers vs axes.
Conclusion: Spear + Axe is a less than efficient way to defend against an attack group that could consist of axes, or could consist of chariots, than just a stack of archers.
Sword vs Axe:
5 * (1 + .5 + .25 + .1 + .2 - .1) = 9.75
Sword vs Archer:
3 * (1 + .5 + .25 + .2 + .2 - .1) = 6.15
One Axe is worth 1.9 Archers vs Swordsmen.
If the unknown attack group is either a Swordsman or a Chariot based, one Spearman and one Axeman can dominate 2 Archers. Possibly not enough to pay for the production cost difference.
Finally, note that an Axeman+Spear defence group can use Axemen to attack the primary-Chariot attack group. As there are no units that get a defence bonus against Axemen, given level terrain the trade-off ends up being quite a lot better than letting the Axemen be attacked. If the axemen manage to penetrate the chariot-defenders, the Axemen are now at an advantage against the Chariots, instead of a disadvantage.
That final point makes a mixed Axeman+Spearman defence superior to an Archer defence even in the Axe/Chariot attack era. But it requires that the defender know how to counterattack with defending forces based on the attackers stack mix (you need to keep back enough axe defenders to soak the axes in the attack stack from reaping your spears, and you need to figure out a way to destroy the attacking stack in the field to prevent it from healing up after your attack).
This is probably too much analysis.
The catapult era is, naturally, different yet again. Catapults make hiding behind city walls (or in general, doing anything except mustering an attack force and destroying the approaching stack) by using your road-advantage, pointless.