It depends on how you start battles. If you do it through the event commands, then you can define what happens at zero HP.
If you are using random encounters, you will need to put on a switch when you enter an area, then modify the game over command to read if the switch is on, to dump the heroes somewhere, otherwise if it is off to go to game over.
Of course, if you are using a custom battle script there may be options in place, and the exact position to alter might change - it depends on how the script was written.