In our game yesterday this question came up. Although battle does not feature in many games of Polis, it did in this one. It's actually a good way to force incremental Prestige shifts when both players are low in Prestige. In those circumstances, it's quite important to determine who blinks first and it wasn't clear to us from the rules.
There is no set order for this in the rules.
One declares a retreat before drawing replacement cards at the end of a round of battle.
The rules do say that the "attacker always draws two cards, but the defender draws one card less for every loss he suffered."
Then the attacker/defender roles switch.
If you want you could infer from this that the attacker replaces cards first, defender second.
That would clarify who would retreat for you.
It is usually clear from the state of the battle who is winning/losing, making it obvious who is likely to retreat if able.
Dramatic turnarounds in the battle from round to round do happen.
It's part of the richness of the gameplay.