They explained the holodeck having back-up power external to the ship's grid so that in the case where there is no hope, the crew has a last refuge of peacefully die at.
It's a bit morbid, and I'm not completely sure I like the idea, but it is something that exists today to an extent (see...