Even then, it’s clearly not an end-of-war victory; the goal was to get what’s left of the Resistance the hell away from the FO safely, and Luke accomplished it.
No war in the history of the world was won by killing every single enemy soldier. What happened at the end of TLJ wasn’t a victory for the Resistancs in any shape or form. The Resistance lost, but a few survived, as in any lost war. The Resistance has no allies. Everyone has turned their backs to them. If for the sake of argument the FO creates a benevolent dictatorship or perhaps even some form of democracy, the Resistance have zero change of ever rising again. So, the few Resistance members still alive have their fate lying completely in the FO’s hands. The Resistance cannot win, the only thing that can happen is for the FO to screw up. It’s quite ironic really.