Unless otherwise specified in the scenario description, battles continue until only one faction has ships in the play area AND the other faction has no way of achieving victory. If the defecation hits the ventilation, you still need to get your ships clear or stay and fight it out. If, for example, you successfully managed to destroy the shuttle in a VIP Escort scenario, the game is not over. Your victorious assassins will still need to dodge the remaining escorts to return to base. If you are defending a Supply Raid mission and lose all your ships, you can still win if enough container tokens exit the play area. Even if you lose a particular scenario, you might wish to fight for final control of the map in order to recover your ejected personnel or prevent the enemy from recovering theirs. It is entirely possible (and intended) that a battle could be a tactical victory (winning the scenario) but a strategic defeat (sustaining heavy ship/pilot losses) or vice versa.