The problem is their lack of shields (which causes them to be vulnerable to missiles), low armor and weak weapon damage - they aren't suited for direct combat against melee-oriented units. Spearmen - units focusing on fighting with cavalry and large units (such as the Giants) in which they are deceptively effective.
Soldiers equipped with swords and shields (the latter allows them to block a portion of missile damage) are used mainly as the starting infantry - their offensive and defensive capabilities won't allow them to keep up with more advanced units that will appear later on. The Empire has access to the following melee infantry units: