At the end of the Ludo rock opera, "Broken Bride," the time traveler has, after slaving at a time machine for fifteen years, gotten stranded in the Cretaceous era, come forward in time to the end of the world. He gives up his last chance of seeing his wife in order to save what's left of humanity. But angels arrive, and grant him his request: to return to that last morning in May. And then — he gets into the car with his wife, so that they can die together. *wibble*
The Steve Miller Band's "Jet Airliner": "You know you gotta go through Hell before you get to Heaven."
Some Bruce Springsteen songs fall into this trope, notably "Badlands", "None But the Brave" and "Land of Hopes and Dreams". Also, in his concert DVD "Live From New York City", filmed during the E Street Band's 1999-2000 tour, during an extended bridge in "Tenth Avenue Freeze Out", he delivered an impassioned speech, telling the audience that joy, faith, healing, companionship, a second chance, all of life's blessings can be yours— "But you gotta work at it!"
"Good Enough" at the end of Evanescence's "The Open Door".
Godspeed You! Black Emperor and "The Dead Flag Blues". The entire song reeks of grimdark, with all the horrors of a ruined world and decay. But as the song goes on, its tone gets a bit more happier, culminating in its last two minutes having a very upbeat and hopeful ending.