Moving from a Ph.D. at a mid-ranked institution to a postdoc at a high-ranked institutions happens very frequently. The easiest path for this is to have solid publications (extraordinary is not necessary) and a good relationship with both your Ph.D. advisor and the supervisor you do the postdoc with.
One of the important factors enabling this is that a strict ranking of Ph.D. programs does not make much sense once you get above a certain base level of quality. Beyond that point, every program is extremely heterogeneous based on the particular professor. Absolutely world class professors are often at "mid-ranked" universities, and people in their particular subfield will know it, and consider that university "elite" in their particular subfield. It's just that you can't obtain this information from US News or other "generic" rankings.
An example: US News currently gives the University of Massachusetts, Amherst, a rank of #60 in the US as an Engineering grad school and #76 overall, but they have an extremely strong artificial intelligence group that practically dominates in some subfields.