Hamas is following the playbook of a relatively obscure 19th century war philosopher who said, "War is merely a continuation of politics by other means". To Hamas, the absolute military result of the war is irrelevant. What is relevant is the advancement of their goal or policy of Palestinian Emancipation. If this war, even by loosing, leads to the opening of the Blockade, it would be a victory for them.
Suspected assailant in car-ramming attack in West Bank shot (Haaretz)