.
What is "the union?" What is "the contract?"
Each union has its own organizational structures, rules, and contracts that can sometimes including a ban on union members negotiating for higher pay for themselves. None of the unions that I am familiar with have such a restriction except for one union for civil servants.
1) Unions set wage minimums and working conditions. You're free to negotiate for more. Underachieving workers receive more, and overachieving workers also receive more because the floor for their negotiations are raised.
2) Employees who do not like the operations of their union have a democratic stake in changing it, or can run for leadership positions themselves. Without a union, their only option for a grievance is to work elsewhere, which is not always feasible (location, family, accrued benefits).
3) Workers have skin in the game and union dues to pay. It's not unheard of for workers to threaten union leadership with non-payment to force a radical leadership change, and there's always the more measured approach of union elections.
4) This is a critical mass problem. There was no decrease in productivity when unionized workplaces were the standard. Without unions you have skyrocketing productivity but wage stagnation. Eventually the wage stagnation turns into a drag on productivity, but in the meantime the company gets rich. It depends on what you prioritize.
EDIT: patmcc has a much better response than my own.