People repeat this a lot, but it isn't that cut and dry.
People often ONLY include the direct cost of the two vehicles. They don't include the massively discounted loans on new vehicles (e.g. 0% APR), the warranties (e.g. 3-5 years bumper to bumper), sometimes better MPG (newer model, etc), cheaper insurance, skipping state inspection for the first three-five years, new tires & other consumables, et al.
Obviously you have to look at specific vehicles to know for sure; but when I last looked at exactly this (recently used Vs. new) without the externalities it was approx $2-3K cheaper (talking CarMax, non-negotiable pricing) but after factoring in all the things listed above it was damn close (within $500-800).
And as you go more used are you really getting a deal or just exchanging miles/wear&tear for cash? The asset also has depreciated in value by then.
Just to be clear, I am simply saying you have to look at each vehicle one by one, a lot of models/manufacturers depreciate at varying speeds (e.g. a Kia depreciates a lot faster than a used Toyota or Honda).