Hamas is set to hand over the bodies of four hostages in exchange for Israel’s release of hundreds of Palestinian prisoners, just days before the first phase of the ceasefire between the warring parties was to expire.