They do defeat him though, they beat him physically and they lose their fear of him, to the point where he grabs Bill and tries to make a deal, which the Losers reject and then rescue Bill, leaving Pennywise to fall into the pit without killing any of them.
I don’t think the film is perfect, I found it too rushed and too blatant in showing too much, but it’s narrative structure is fine.
Nightmare has the cheat ending. Oh you think it’s this? No, it’s that!!! Any catharsis is yanked back at the last second.