There 'seems' to be no way, which could mean that there is a way. The first thing that comes to mind is that you mentioned that her head is out of the cave. Shout for help? She's on the coast, she's in a cave, and she's leading a group of people, which infers that this could be part of some sort of tour? If so, someone should realise something isn't right when they're not back after however long it's been. They may go to the cave, and try and free them from the outside, much easier.
But if none of this is possible, the only option would be to use the dynamite. In fact, I doubt there'd be too much of a choice. If there's a good number of people that are going to die, it only seems fair that the majority should go free. Also, they have the power to decide. They can all say, 'look, we don't much fancy drowning today, in a bit love.' That is, unless they're all feeling particularly friendly that day, and will all sacrifice themselves for her.
Also, if they decide against using the dynamite, she'll die anyway, right? If not, how will she get free, other than someone finding her? If someone is going to find her, there's no reason why they can't do it before the dynamite is used.