Unions have a well deserved reputation for putting seniority over merit. If we ever figure out how to Unionize with meritocracy as the focus we can solve a lot of problems for labor.
Unions I’ve worked in or am familiar with do care about seniority over merit as you mention. They also make it so new jobs need to go to internal candidates over external candidates. Furthermore, internal candidates are even provided retraining opportunities. Management needs to show there is no one in the organization capable of doing the job before opening it externally.