Young people work for less money because they are inexperienced. The older worker has to provide the same value for their higher pay via experience. And this is where the problem comes into play: the potential employer might not see the older worker as being worth it, especially if it doesn't appear that they can do more than the younger worker. They might also see potential (room for growth) in the younger candidate that they can't see in older ones. And this is all quite reasonable....also remember that most companies are pyramids, with lots of openings in the bottom and much fewer as you go up....
So you as the tech employee must be aware that your life is short if you don't continuously grow your skills so you don't become an unjustifiable expense later in life. Not only that, but you have to become an expert in marketing these skills.
For anyone it's a matter of working your strengths, and there is nothing a young employee can do against very deep specialist knowledge in a senior employee.
Maybe the problem with the senior workers, is that they are too generalist for the pay they expect. And maybe in too many cases, the expectations to the products produced are not high enough to warrant the pay of a senior developer, which there is nothing to do about, other than raising expectations.
So you as the tech employee must be aware that your life is short if you don't continuously grow your skills so you don't become an unjustifiable expense later in life. Not only that, but you have to become an expert in marketing these skills.