This post is touching on two issues that are somewhat related but different:
1. Finding ANY job when you're 60 is hard;
2. Engineers (who are still engineers) at 40+ will often be passed over in favour of twentysomethings.
Engineering is such a young industry that I'm not sure we've really faced (1) yet (since the number of people who started engineering in the 70s is but a drop in the ocean compared to the number in the workforce today). It'll be interesting to see how the industry has evolved in 30 years.
(1) is a pretty strong driver for everyone having a long term plan to control your own fate, which means working for yourself. That is, if you're not in industry with inbuilt protections (eg teaching).
(2) is harder to pin down.
On the one hand, there is a certain (un)survivor bias in that many who started as engineers in their 20s are managers or the like by their 40s. So are those who remain in engineering a good sample?
Also, the older you get in general the more non-work priorities you have. Family, for example. This can reduce the amount of time you spend on self-improvement. This industry almost requires constant learning, reinvention and skill acquisition. Is it an example of ageism if someone who is 45 can't find a job when what they know is Ada, Cobol and Forth?
It's often said that a good technical foundation and education means you can pickup any language. This is true but picking up new skills is both a habit and a skill, one that atrophies if left untapped (IMHO). It's also a question of degree. Perl to Python? Not a big gap. Ada to Ruby? Well....
That all being said, there is age discrimination in this industry. I've personally witnessed someone say "I prefer new grads so I can mold them". That's fine and all but if you say that and don't hire a 50 year old programmer that's a good basis for an age discrimination suit because, well, it is age discrimination.
So yes, you either need to find a job that doesn't change (eg a plumber or a teacher) or you need to constantly battle to maintain relevancy in a fast-changing industry or you need to become master of your own fate.
This is known.