Taking math or stat course to prepare for my PhD?
Recommendation letters for PhD programs are weighted by the reputation of the writer only up to a point.  When an admissions committee reads a letter saying that the student will thrive in a top XX PhD program, we want to believe that the writer is qualified to make that statement.  In mathematics (my field), this means that we generally want the letters to come from faculty members with PhDs in mathematics (or a closely related field).  It helps if the faculty member has some experience and perspective with evaluating undergraduate students, and it helps if they have met or interacted with graduate students from top XX programs.

That's about it.  Notice that I did not say that the faculty member has to be especially eminent in the field.  Just because one faculty member has a more distinguished research program than another does not imply that she has more insight into which undergraduates should go to which graduate institutions.  I might go so far to say that many superstar faculty members I know did not get to be superstars by paying extraordinarily close attention to the undergraduates in their institution: a more teaching oriented faculty member could actually be more insightful.  

Another thing to realize is that taking a single course from a faculty member is not a recipe for a really incisive recommendation letter.  A lot of times these letters basically convey the information that the student got one of the highest grades in the course, just like other students from years past who went on to graduate success. In this situation it is probably the quality of the program that matters more than the reputation of the faculty member.

So I do not recommend that you choose individual courses based on faculty reputation for future letters.  Remember that admissions committees are also looking at your coursework, and that you took the strongest courses available to you and did well in them is both one of the most important aspects of your application and the aspect that is under your most direct control.  So taking an undergraduate course as a master's student just because you think that a superstar will be writing for you is a bad idea, I think.  What is the superstar going to say about you: that you really nailed a "very basic course for undergraduate students"?  (Note though that you might still want a letter from this person, but if so you should have a more meaningful interaction with them.)  I don't know enough about statistics programs to help you decide between options 1) and 2).  The only thing I can think of is that you have already taken Real Analysis II, and the fact that this version is more in-depth might be lost on the committee.  

Finally, all in all most master's students do not switch to PhD programs at significantly higher ranked institutions.  It's certainly possible, but it would be safer for you to plan in a way which is good for you whether you go elsewhere or not.  So I suggest you talk to your advisor and explore which of 1) and 2) is actually a better course for you to take...I mean, better for a student in your current situation.  Then take that one.