Don't worry, he gets to live. His storyline was never supposed to end like that. That's a misunderstanding of the game's ending. The game goes out of its way to hint that Frisk goes back to save Asriel as well by showing Frisk do the same for other characters as well as himself in in his Flowey state.



Frisk makes it out of the Underground in a Neutral Pacifist play-through but willingly resets so he can save Asgore's life (despite knowing it would trap him Underground forever), and continuously doing the Neutral Pacifist route in order to help Flowey and become friends with him.



The game doesn't end with a sad end for the sake of it. That would be stupid and is the thing the ending openly mocks. The whole game is a commentary on different aspects of game design and storytelling. The ending plays out the way it does because it's making fun of the fact that several games have "tragic" endings for the simple sake of having a tragic ending without any good reason behind them. These other games give no justification as to why they end the way they do, or have an obvious solution to the problem but don't have the characters think of it. The game ends without the player having the option to save Asriel because it's making fun of the fact that lesser games do that kind of stuff all the time when there's no meaningful reason to do so.



It also parallels the Genocide route. When you complete that route the player is able to sell Frisk's soul to Chara in order to recreate the world. The player isn't allowed to do this in the Pacifist play-through because that's not something a moral person would do. Nobody who cares about the well being and free will of others would sell someone else's soul to save another even if they had the ability to. That's something for Frisk to do on his own because it's his soul and his right to do so. The fact that he willingly trapped himself back Underground with no way of getting out because he wanted to save a single person's life, and continuously goes back to Flowey to find a way to save him from his suffering because he can tell there's a tragic person underneath all that hatred shows that Frisk wouldn't just give up to save everyone at the end. Especially not when he finds out that the person he was trying to save before is truly a good person and one of the most selfless people you could ever meet.



The game ends this way so that you can imagine how Frisk saves Asriel rather than making how it's done an absolute by showing it. However Asriel's restoration and salvation is confirmed.