That is one thing unions specifically address..."work rules". What can, and cannot, be automated.
It does require the union to have the upper hand in the first place in order to get a company management to sign a union contract with restrictions like that.
However, for this particular story, it makes no sense, because the union only has leverage with their employer, not with the big name companies that have chosen their employer as the provider of the service. The big name companies would just switch to a new provider if they didn't like what was happening.