That is why software engineers also need unions. (but the time to organize was back when we still had the upper hand)
If there was a union in place, the massive over hiring that led to this wouldn't have happened and the competent developers would have made less money. So how exactly does everyone come out ahead there?
I don't know about how a union would affect the standard salary being offered. I'd say that it could be higher for those essential enough to be "core staff", those that the company hires permanently knowing they'll be hard to get rid of and who drive the company forward because they're motivated with additional means.
So a union might drive the salaries and employment conditions up for the "core" team, while driving them down for the "temps". I've been through this as a unionized tech worker in both categories, and this is how it played out.