Hamas released the three men as part of a staggered hostage-for-prisoner exchange under a 42-day cease-fire deal that went into effect last month.