They will still be utterly defeated and Gaza depopulated unless Hezbollah joins in. Due to blockade Hamas always had a limited set of weapon stockpiles. Only Hezbollah and Iranian proxies has the freedom and money to gain whatever weapons they need.
So, now the key question in this fight is what Iran and hezbollah does.
there are a few reasons why hezbollah has to join, if israel attempts to occupy gaza
1. the US has already said that hezbolla joining the fight may not trigger their intervention.
2. as others have said, once hamas is gone, hezbollah is next.
3. hezbollah will never find israel in such a terrible position again, caught off guard, criticized around the world, and short on ammo. their biggest ally the US is also governed by democrats, which may not be the case in two years. the US is also very distracted by ukraine.
4. this one is not talked about enough. iran wants to be seen as a leader of the muslim world, but iran cannot intervene due to distance. iran would absolutely want hezbollah to intervene, because everyone sees hezbolla as an extension of iran. so if hezbollah joins, the muslim world will give some of that credit to iran.