Re:It's a win-win situation (for them)
At the beginning of the series, red dwarf had been found... flying on an exploritory mission in the starbug's laundry basket populated by krytens self-repair nanites (they'd taken the ship, and converted most of its mass into a small moon... After kryten gave them a strict telling off, they recreated red dwarf, along with all the dead crew (including rimmer).
The last episode ran something like this (to refresh your memories)...
Red Dwarf got infected with some metal eating superbug.
The science department developed a portal into a mirror universe which Lister entered, to find everything reversed, he was the captain, the captain was as useless as lister is normally, cat was a genius, etc.
The mirror universe had an antigen that could kill off the superbug on "our" red dwarf, so dave took the formula, but when he travelled back through the portal, it transformed to the formula of the superbug itself, leaving the dwarf doomed.
In the last scene, cat, lister and kryten made it through the portal to escape red dwarf's destruction, but a vending machine that had it in for rimmer prevented him from going through when the ship blew up (meaning yep, he's dead again).