They’re surrendering with a purpose and I doubt it’s to save their own life....they’ve been ‘’ordered’ to do so by their leaders.
Hamas assume that after a while, Israel is going to leave. So Hamas will just rearm and attack Israel again.