Endorsement money, much like prize money, increases at a rate much faster than inflation.How much did Federer make from endorsement when he was Nadal's age? You are free to adjust it for inflation for the last 5 years which would be couple of hundred dollars maximum. That would be a fair comparison.
Edit: OK found it http://www.therichest.com/celebnetworth/athletes/tennis/roger-federer-net-worth/
Federer made about $25 million from endorsement in 2009 whereas Nadal made $30 million in 2014 from endorsement. So there you go!
You have to look at players' endorsement money they get at the same time period otherwise the comparison is meaningless.