You can go into academic medicine from schools that aren’t high powered research institutions, provided you’re an absolutely stellar student during med school with top grades, top USMLEs, top LORs and significant research done during med school. (BTW, you’ll need all of those even if you do attend a top ranked medical school if you want to go into academic medicine.)
As an example, our state med school (mid-ranked) sent grads into residencies at Harvard, Yale, JHU, Vanderbilt, Duke, Stanford, Mayo and UCLA this year.