Allen doesn't die. The creators of Invincible comics have kept him alive to drive the story forward and engage the readers with his ongoing adventures.
It's hard to say for sure. Some parts of the story might be based on real events, but there could also be fictional elements added for dramatic effect.
Barry Allen's death in the comics is a complex situation. Sometimes he does die, but often there are plot twists and resurrections as part of the ongoing comic narrative. It all depends on the creative direction of the writers and the demands of the story at that time.