The decline in learning and performance that Reheat speaks of is real. It is most likely due to the effects of the ageing process. It is not age that is discriminated against, it is poor performance. The fact that it may be slightly more common in older wannabes can make it seem like it is age based discrimination, but the number of successful older wannabes puts the lie to that. There are always exceptional older wannabes who will get through training with good scores and first time passes even as there are exceptionally poor younger ones.
If you don't believe Reheat's statement that it is harder for older people to learn new skills, go buy your grandmother a cell phone or PDA. My 75 year old landlord can't even use a computer mouse. I realize these examples are a bit older than the 30s and 40s lissy asks about, but I bring them up to illustrate the effects of aging, not to show precisely in which decade one crosses the line of decline.
I think there probably is some age discrimination out there for low hour newbies, both against the very young and the 35 plus low hour pilots, but HR people are really good at keeping it under the radar, so you'll probably never be able to build a winnable case if it happens to you.