There is also a thing called unions.
Think of it like ageism. The time to do something about it is when you have the leverage. Not when you’re over a barrel.
It's like how they say the best time to jump jobs is when you're doing alright, and not when things are desperate or you're clearly on the way out.
I think you just answered your own question. Unionize while you have leverage to protect yourself for a future where you might not.
Edit: the only story I've heard in tech that involved unions was the strike at the Eugen gaming company, and as far as I can tell, they had pretty good reason to strike.
Until you age out.
And you will age out.