who wins the final battle in once upon a time