against most things halberdiers are your best choice. But, not by much. In many cases it really doesn't matter which state troops hold the line (and die in droves) while your knights get into position. Some spell effects change that sad truth, e.g. that extra rank makes a big difference if you can get mindrazor of.
I think they can be nasty with the extra rank and a WP with hatred. The re roll to wound is always nice but with Battle Prayers being a loe cast bound spell, unless you've managed to draw all the opponents dispel dice out earlier in the phase, then they're easy to stop.
I see state troopers serving two builds. Either you want them to hold the line and block people or get swole and grind people.
If you going to do a grind option, you take halberds + razor standards + light magic + warrior priest + hurricanum. This option is easy to make a large horde that survives off its wounds and once it gets in CC can do some serioues damage with -2 save, 2+ reroll to hit, and any buff you can add in.
The only option is to just hold the line with cheapo steadfast units. That means taking swordsmen to rely on better armor, weapon skill, and parry to last just a little longer.
Spears fall in the middle of both camps. They do neither job as well as the specialist. You don't particularly save a lot either. A unit of 40 spears is 200 vs 280 for the more expensive swords. Those savings are not significant enough to warrant loss in effectiveness in either task.