I found where the reversal happens.
GameRules.ms, Lines 17, 18, 26, and 27 read:
winner = (rnd < p)
spaceForces[1 - winner] -= 1
...
winner = (rnd < p)
landForces[1 - winner] -= 1
...The way "winner" is treated in Lines 18 and 27, "winner" is SUPPOSED to represent "which side (0 or 1) won a specific round of combat". (dialogs.ms always treats the Empire as side 0 and the Independent planet as side 1.) HOWEVER, "p" is SUPPOSED to be the probability that side 0 wins a round of combat.
If side 0 has a large tech advantage over side 1, then "p" is large, "rnd" is more likely to return a number less than "p", "rnd < p" is more likely to return 1, which makes "winner" equal to 1, then spaceForces[1-1] (in other words, spaceForces[0]) is decremented, and the victorious Empire loses a ship. :P
...
This is an easy fix. Lines 17 and 26 must both be changed to
winner = (rnd > p)
to fix this problem. This should work properly even if this code is later used for fights not involving the Empire.