Hamas did use hostages for leverage originally, that was the point of them and they did release them when they got some trades for prisoners and a ceasefire agreement ( before that was broken in March). It seems clear no ceasefire or prisoner/captive exchange will happen now though.
Hamas probably hope the hostages’ families will persuade Netanyahu to do a deal and agree a ceasefire but it seems clear enough he won’t and that the US won’t tell him to.
Surrender and releasing the hostages is what the Hamas captors should do, as you say but somehow it seems unlikely they will do this.
I don’t actually think Netanyahu would stop if they surrendered though, as there will always another tunnel to bomb, another Palestinian going into a building who is somehow under suspicion and needs bombing and on it will go so Netanyahu can keep a war going.
Maybe eventually, at best, there would be an Israeli military controlled Gaza for remaining Palestinians; with Palestinians encouraged to leave and Israeli settlers moved in.
It probably isn’t in the character of Hamas to surrender now. They might feel they have nothing to lose by fighting to the death and taking all the civilians with them. Horribly, the Hamas fighters guarding the hostages will most likely just kill them if they are cornered. The hostages’ families must feel desperate.