Hamas can't defeat Israel period.
Probably they can't, however they try to make as much damage as possible in the meantime, radicalize as many Palestinians as possible, and wait for the "good occasion".
It doesn't mean that they are rationale about it, but this seems to be Hamas strategy.
At the same time Hamas doesn't care how many Palestinians die due to their actions directly or by Israel reaction.
If they care about the welfare of their own people they would work to improve relations with their neighbour.
Considering the rockets Hamas is able to launch and comparing that to what Israel is able to mount, I'd say the nuisance
It is a nuisance in comparison to what Israel can mount, but it is not a nuisance for Israel citizens.
It's not a nuisance for Israel political leaders who have to respond to their electors.
It's not a nuisance when Hamas get get hold of ever more powerful missiles in growing quantities.
Gazan civilians have little control over what extremist factions will do next, but still suffer the consequences).
That's the sad part of it, whatever Israel and Hamas do, it's the Palestinians civilians who pay the highest price.
The economic argument definitely falls "in favour" of Gaza, which has been under continuous embargo from Israel; furthermore, the number of rockets fired from Gaza can hardly be called a mounting economic cost on the Israeli side, especially compared to what is being spent on control of the West Bank... If indeed, as you argue, it is a war of attrition, then Gaza is on the losing side, not Israel.
If you assume, as I do, that Hamas doesn't care about the sufferance they inflict to the Palestinians in Gaza then the cost is only on Israel side.
From Hamas point of view the cost in lives and economy suffered by Gazan is not important compared to the "great ideal" of destroying Israel, so it's cost zero.
If Hamas really cared about people in Gaza they wouldn't shoot missiles across the border well knowing what reaction they will get from Israel.
Since the root lies in Israel's consistent (mal)treatment of the Palestinians, I don't see an end to either Hamas or the more radical groups - on either side. The PLO went the political way, but current events aren't helping do Hamas the same.
Pointing the finger only against Israel or only against the Palestinians leads only to a never-ending circle of recriminations.
At this point what it counts is not "who started it" but "How to end it".
Hamas has to understand and admit that Israel is there to stay and not dreaming about its complete destruction.
Israel has to understand and admit that Palestinians have right to and independent and self sustaining state, and Israel has to lift embargo as well as open the wallet to make it happen.