The outcome showed the diminished sway of the Iran-backed Hezbollah militant group after its devastating war with Israel.