Unions don't add economic value, hence why employers don't like them. The way they secure higher pay is by going on strike, not by offering more production or value.
How would unionizing prevent you from being replaced by a machine? Striking isn't a threat when you not being there is what the company is going for anyway.
Automation is not instant, and if the clock is between “implement AI correctly to automate the work” and “run out of money because you have no workers” a strike is still effective.