he didn't get to do any tests, the web site he was using to apply determined that he was over 35 and rejected him. When you said you were surprised he passed the tests you showed the most absurd amount of ageism since you know nothing about the guy other than he is 50!
I don't think length of service is a huge issue, if someone is 25 there's always a high chance they'll want to change direction in the future and do something else. The 35 age limit would allow for a massive 25 years of service, which is a pretty exceptional amount of time in a job these days, so using possible length of service as a reason doesn't really wash.