It's still not clear. If Hezbollah ends up disarmed and the Lebanese army takes the south, which is very much possible, since these are in 1701 resolution, then Israel would've achieved its goals.
For now, I think both lost and gained.
For Israel, the downside for this is that they weren't able to destroy Hezbollah militarily after 32 days of full air attacks. Just before the ceasefire, Hezbollah threw one of its biggest loads of missiles in a single day on Northern Israel. The Israelis were also clearly reluctant on the ground and suffered a lot of losses in those few towns they occupied. Even though they set a goal for themsleves just a few days after the war started to make a buffer zone, they restricted a lot their ground operations, and imo because they were surprised by Hebzollah's discipline, organizations and military capabilities; especially its anti-tank missiles which damaged a lot of Merkavas, previously thought as invincible. Plus, Israel accepted the ceasefire without a condition for the release of its Israeli prisoners. All of these factors have greatly hurt Israel's confidence.
However, the whole thing can end up with the disarmament of Hezbollah, which would greatly diminish Hezbollah's influence in southern Lebanon, and that would be a big blow for them. That's what Israel and the US are relying on, that the pressure of the Lebanese government would force Hezbollah to disarm probably after solving the issue of the prisoners and the Shebaa Farms.