What can airline pilots do if they are no longer in the position to fly, career-wise?
When I worked in the design department of an aircraft company, I had two types of coworkers: Those with and those without a pilot's license. You could easily spot the difference. In aircraft-related engineering decisions it was soon obvious. I mightily preferred to work with other pilots - they would have a much better grasp of "what looks about right" and not pursue hare-brained, outlandish ideas.

See it this way: All managers in car companies have a driver's license, so they have at least some contact with what their companies make. All higher managers where I worked had no pilot's license, and it made work outright awful. They were trained as beancounters, and that restricted their viewpoint. They were simply incapable of telling good engineering from bad.

If you have managed to get a CPL, adding an engineering degree on top is not hard. That is my advice to grounded pilots: Go to engineering school and enrich the workforce with your experience.