Can Budapest Semesters in Mathematics outset the disadvantage of not attending a prestigious undergraduate for top graduate programs in Mathematics?
I have pretty significant anecdotal insight here.  I went to a very good but not quite top tier ( in math ) school and jointly majored in a humanities degree and a math degree.  I was active in the math department, but was not the top student.  I took maybe one or two graduate courses as an undergrad.  By my senior year I decided to focus more on math, but didn't think I would get in to a top tier graduate program ( and, for me, it wasn't worth it not to go to a top tier program.  Please keep in mind that this is not true for everyone and was a personal choice ).  I was confident, and received confirming feedback from professors, that I probably would not be able to achieve this goal with my background. 

In my senior year I applied to several scholarships for graduating undergraduates, like Fulbright and Marshall scholarships, but did not succeed.  I then applied to and was accepted into BSM.  It's an excellent program, and I would say that it's an even better opportunity to learn a lot.  When I was there, academics was not 100% the goal for around half of the other students; for many of them it's the "study abroad" experience.  I do not mean to disparage them at all; this experience can be very important for personal growth and perhaps even more important than the academic experience.  I simply mean to point out that you're working with absolutely top tier educators and mathematicians who care very much about the program and if you're there for the academics then you have an opportunity work closely with them and have a lot of access. 

I focused extremely hard both during the summer before BSM, and during my time in Budapest, working on a ( small ) independent research project and rounding out my background, while making sure that I excelled while in Budapest.  I can echo the other answer that the courses were quite difficult, probably closer to a graduate level than undergraduate ( although I probably took more advanced courses ).  

Anyway, punchline of the story is that I got in to the top school of my choosing for graduate school.  I had recommendation letters from BSM professors and from professors from my undergraduate institution.  I don't know how they evaluated, but I believe that my strong grades from undergrad ( at a near top but not top school ), my activity in undergrad activities within the math department, and my performance and dedication ( eg. research ) in BSM were the major contributing factors.  Regarding the school I attended for graduate school, most students were high school olympiad medalists ( I didn't know what the olympiad was until college ) and/or putnam finalists ( I participated 3 years, never getting honorable mention, but scoring okay ).  I definitely felt like I was the "least" among them, but learned later many of them felt the same about themselves ( see "imposter syndrome").  There were a couple of top tier graduate programs that rejected me, so I'd say that the experience put me in the mix.  

So, moral of the story for me is that it can absolutely help you.  It requires, however, a lot of effort and at least a pretty good background on top of that. I would also like to emphasize that I know many people that had amazing experiences and learned a ton at next tier and next next tier graduate programs, some of whom have successful academic careers.  The best of the best students in my graduate program got something out of being with those stratosphere level professors that, to be honest, I was not capable of.  My guess, although every story is different, is that you may have an even better experience at a next tier graduate school rather than top tier.