TurboTax does not ask me to whom the medical expenses apply.
Under the Tax Reform Act, the number is 7.5% of AGI for all ages for 2017. However, the IRS has not yet updated Schedule A, so TT cannot do so yet.
But your point is a valid one.
If you are claiming expenses for a dependent then the rule is based on your age not theirs since this is your tax return not theirs. Same would be true in reverse ... a 65+ person with a 40 year old dependent ... it is based on the primary taxpayer's age not the dependent's age.