Query: who wins the final battle in once upon a time

Relevant passages:
The Final Battle (Once Upon a Time) <=SEP=> In the episode, Henry and Emma work together to defeat the Black Fairy; in The Enchanted Forest, Snow, David, Hook, Regina, Zelena, the Queen, Aladdin, and Jasmine team up to save the worlds from being destroyed.

The Final Battle (Once Upon a Time) <=SEP=> Both Gold and Belle set off to search for Gideon's heart. Henry helps Emma escape from Gideon (knocking him out with a fire extinguisher) with Emma placing a protection spell to contain him temporarily. The others realize that Fiona has crafted the perfect trap: If Gideon kills Emma, Light will be destroyed. And if Emma kills Gideon, she will turn dark and Light will still be destroyed. Regina consoles Emma and encourages her to find another way like she always does. Emma attempts to hold off Gideon as Gold finds Gideon's heart. When Gold finds Gideon's heart he is tempted by a manifestation of the Darkness, which takes the form of his Enchanted Forest counterpart, Rumplestiltskin. The Dark One manifestation tells him to let Gideon kill Emma so he can finally have it all: power and love. The manifestation reminds Gold of what Fiona told him, that if Emma dies his Dark Magic will increase exponentially. After it's all over he can spend all the time he wants exploring the world with Belle and/or destroying it. Gold resists temptation and chooses to do the right thing and tries to use Gideon's heart to stop him from killing Emma. However Fiona's spell keeps him from being able to free Gideon and instead Gideon's heart stops beating and dims. The manifestation taunts Gold before disappearing and Gold heads out to Belle who consoles him for trying to do the right thing. Back at the intersection, Emma and Gideon fight with Emma acknowledging her role as the Savior to protect those she loves, protect the innocent and to spread light and hope no matter what the cost. Realizing what she must do, Emma throws down her sword and Gideon apologizes and kills her releasing an enormous blast of light magic, ending the Final Battle and causing Gideon to disappear.

The Final Battle (Once Upon a Time) <=SEP=> As everyone gathers around Emma's body Henry, using true love's kiss, brings her back to life. Gold and Belle discover to their shock that Gideon is once again a baby with his heart restored into his body. Realizing that this is a new start as a family, Belle tells Gold that this is their happy beginning. Snow then sees the "Once Upon a Time" storybook reappear. Henry looks at the final page of the storybook which suddenly writes itself with the words "When both good and evil did the right thing, faith was restored and the final battle was won." Snow reminds everyone that the story isnâ€™t over. The Enchanted Forest, Neverland, Wonderland, Agrabah, Arendelle, the Land of Oz and all the other realms are restored and their residents obtain their happy beginnings, as does everyone in Storybrooke. Emma and Hook patrol as the town Sheriffs, Henry goes to school, Regina returns to her role as Mayor when dwarfs gave her title "queen" without "evil", David farms with a growing Neal, Zelena spends time with baby Robin, Gold and Belle renew their relationship and raise their son together, Snow White becomes a teacher again and Robin Hood propose to the Evil Queen in Regina's restored palace. They all gather together at Granny's to celebrate their lives together.