Hermione tried not to let panic seize her. They won’t be stuck here forever, they will come for them eventually. She prayed for them to find the snake in one of the rooms. But there was no floor left, so if Nagini is not in that room, they won’t be able to search anywhere else... And the sword was with them, so even if they do end up finding the snake, they won’t be able to kill it...