We tried to parse this out in two previous threads, and no one had any data to back it up, it is probably an unanswerable question. What can be said is that ultimately between 10-25% of the graduating classes at the top 25 universities matriculate into med school. It is of course possible to argue, and is probably correct, that 33%+ of the freshmen at these universities start out "pre-med", and many don't end up applying, but I would argue the majority of those students who don't end up applying actively choose other lucrative career options, rather than truly being "weeded out" in the intro chem and bio coursework.
There is also no data to cite indicating that more students at top schools are "weeded out" of the premed curriculum due to poor grades, than occurs at the exact same intro bio and chem courses at lower ranked schools. Frankly, with the notable exceptions of Princeton, WashU, MIT, Cornell and Hopkins, I would argue the remainder of the top 25 demonstrate grade inflation that would offset this phenomenon. Basically if you can survive some B+s in 2-6 pre-req courses, you will easily pull A-s and As in small 15 person science seminars in upper level courses that students at lower ranked schools don't have access to.
Third, by definition you have to measure "the percentage of students who apply and get in". Therefore, if 25 schools, which account for 25% of MS1 seats, show an average admit rate of ~80%+, you must have a large pool of schools with admit rates substantially below the national average, in order to arrive at the frequently cited ~40% admit rate. Criticizing how the 80%+ stat is built does not in any way change this phenomenon.
Lastly, "many freshmen" at all undergraduate institutions "throw in the sponge and give up on a medical career", your burden of proof is to show that the rate of this phenomenon is higher at top undergrads in order to make this point.