Not all unions are against a vaccine mandate. Many were totally on board, including police and fire fighter unions.
Some unions are OK with the mandates, but didn't like that they were bypassed in negotiations. Some, just to retain power, others, with a real desire to protect some of their workers who couldn't get vaccinated and to hash out penalties and grounds for being fired.
The union leadership that are totally against a mandate need to check in with their constituents whom they're supposed to be representing. The majority got vaccinated and may not be happy with their union leadership being anti-science and anti-vax.