I've been in the technology business for almost 20 years now. In my personal experience, older engineers are much more productive than younger engineers. Younger engineers are much more likely to partake of the "free" dinner offered by the company and work 80 hour weeks. They are also significantly cheaper.
To HR we (engineers) are a fungible commodity anyway. Of course they go for the younger people. Given that they command lower wages AND work more hours their effective hourly rate is much lower. So it's a no brainer.
Of course, I would guess from experience (although I have no specific evidence) that older engineers are cheaper in a productivity/dollar sense, but that doesn't even enter the argument in a modern corporation.
Unless we get into management, we older folks (Lord, is pushing 40 really older now?) are better off in .gov/defense jobs or working for small companies where individual people (may) value our contributions.