Battle ends immediately when the last Baddie is defeated (resulting in success) or the last Gearloc is KO'd (resulting in failure). If an Encounter defines a different success for failure condition, it ends as soon as that condition is met. When fighting Tyrants, the Battle ends as soon as the Tyrant is defeated, even if Baddies remain.