Three Israelis and five Thai captives have been released as part of a ceasefire deal aimed at ending the Gaza war.