How often do mathematics professors move up from mediocre schools to good ones? How often do mathematics professors move up from mediocre schools to good ones?

For example, let's say someone did some ok research at a postdoc and then went to industry for 10 years and afterwards got a professor position at a very mediocre place where they started pumping out solid papers over a few years. 

Given that they had the talent to get a top 50 research school position on a traditional route, what are the chances that they get there in this situation?
I think it will be hard for anyone to answer this question in the literal terms it was posed, i.e., by giving you a numerical probability.  I don't know how to compile a list of all mathematicians meeting your requirements and/or those that went on to top 50 universities.

Let me try to answer more qualitatively.  People do move from one university to another, most commonly before they are tenured, but mobility at all levels is increasingly common: a substantial minority of all tenured math faculty move to a different tenured position at least once over the course of their careers.  (One way to try to quantify this would be to look at the Mathematics Genealogy Project; if someone has supervised more than one student at multiple institutions which are not in close proximity, it is likely that they moved after tenure.)

I don't know if you've heard, but things are very competitive now.  I am at roughly the 50th best math department in the US, and the people that we've hired in the last decade are doing a lot better than "solid work"; most of our recent hires are internationally renowned in their fields.  If you're going to hire someone more senior, then you'll have to pay them more and you worry that they will not stick around as long, so in most cases they have to be better than the stellar younger hires.  Exceptions include departments who want to found entire research groups; for this you really need a senior person, and that person's leadership / mentorship / overall activity and connections in the field may be more important than the excellence of their work.

So to be taken seriously as a senior hire, someone needs to have excellent work beyond even the impressive going rate for a younger hire.  These are the parameters independently of how long they spent away from academia: hiring committees will look at the best work a candidate has ever done and compare it to their work in recent years.  You don't need some minimum number of total papers, and you don't get credit for time served.  If you've done several really great things in the last few years, the last millennium portion of your CV is not really relevant.  

Let me also say that although I am painting a picture that transitioning to a top university is a hard road, it is certainly not an impossible one.  I can think of at least one person in my field who took several years off to work in his family business far away from any academic epicenter.  When I knew him he was back in academia with a pretty decent position that I, if I'm honest, kind of wondered how he'd landed.  Ten years later he is at one of the world's top universities and has won many awards.  How did he do it?  By doing great work.  Really great work: as in, resolving major pieces of very famous conjectures.  It's just that easy...and it's just that hard.