This thread is so old that it's probably considered better to start your own rather than bump it. It contains some reference to old bugs which have since been fixed.
Is there some unmentioned stipulation like you can't ally with one of them at any point in game.
Yes, the conditions of the achievement clearly state that you must defeat X hard enemies on your own. That means no allies allowed. This is because it's possible to load yourself up with allies and lock the teams. Especially with the new extra-high difficulty settings, it'd be an achievement to actually lose here. Typically these achievements are completed by locking the teams and forcing everyone to be enemies. So long as there are five "hard" AI enemies, you get credit for the achievement once you win.
Or do you have to choose "keep playing" from the surrender screen to completely exterminate everything?
No, you don't have to do that, you just have to defeat them.