The hangings were the latest involving detainees regarded by rights groups as political prisoners accused of spying for Israel.