Does a post doc at a prestigious university make up for doing a PhD at a lesser ranked university for Mathematics?
Actually, what is better is what you do in whatever circumstances you end up in. If you are productive and publish good research, the institution at which you do it is of little importance. But any institution at which you can find good collaboration resources, such as weekly seminars in field, are valuable. Larger places which larger faculties tend to have these. But even quite small institutions manage it.
One of the reasons that few people are winding up with tenure track positions at R1 universities is that the number of total positions offered in a given year is small compared to the number of potential candidates. So, the competition is fierce, but it doesn't consist of ranking the candidates in the order of the prestige of their institutions.
Go where you will find people with similar interests and who are willing to work with you. Write a lot of good papers. Build an expanding circle of collaboration. The very best faculties are not, in fact, concentrated at only the very most prestigious universities.
Note also that doing mathematics alone without any feedback or synergy is very difficult. So, a group of like minds is very valuable. It is possible to wind up at a prestigious place where there is actually no one to give you any support. It will be difficult to advance from such a situation.
If your postdoc advisor is academic-famous (from whichever place) you'll be OK on the job market and your PhD won't matter very much. If your postdoc advisor isn't famous going to Princeton is just one more deck chair on your career Titanic.
Famous, academic-powerhouse types mostly hire from other famous academic-powerhouse types, so if you've missed getting into that club early you may be screwed. There will always be a couple counterexamples but the odds aren't exactly in your favor.