Depends on the union and "union culture".
Bad union: Cashiers at grocery stores in Canada and Japan - successfully prevented their duties from being expanded to bagging groceries. Result: self checkout is actually easier and faster than using a human (you can take the item out of the cart, run it across the scanner, and put it in the bag in one motion. Versus unloading the cart onto a belt and then loading things from a different belt into bags). And soon Amazon's system which simply electronically charges you for whatever's in your cart as you exit the store will put pretty much all these places out of business.
Bad union: in NYC the "token booth" clerks were being made irrelevant due to vending machines and security cameras. Transit tried to expand their duties, and lost against the union. The incident where a woman was raped in full view of staff who did nothing to intervene did not help (until that point one of the union's selling points to keep stations staffed was "safety"). So they simply started closing booths and replacing them with push button kiosks that connect people to a call center to ask their questions, and an emergency button to call for help. If all the booth person can be counted on to do if a crime is happening is call the police, any nearby warm body can push a red button to do the same.
Good union: white collar ones. They generally stay out of the way. They still of course try to keep the number of employees up, but are far more open to re purposing existing employees and titles.