The government isn’t a good comparison. Unions hold no illusions about acting in the interests of the general public. Their express purpose is to protect the members of the union, even if that comes at the expense of the general public.
Police unions defending corrupt police and ensuring they can collect expensive public-funded pensions after blatant misconduct against the public is a prime example.