They kept them on board because, according to my understanding, it wasn't safe for them to detrain to transfer them to another train until they secured the scene and that situation.
It's never a safe experience when they're running out of water and facilities.