In the United States, this is absolutely not true.
> The Age Discrimination in Employment Act (ADEA) forbids age discrimination against people who are age 40 or older. It does not protect workers under the age of 40, although some states have laws that protect younger workers from age discrimination. It is not illegal for an employer or other covered entity to favor an older worker over a younger one, even if both workers are age 40 or older.