Premise: I originally asked this on MathOverflow, but it was pointed out to me that it could be better fit for Academia Stack Exchange.
Note: I have received extremely varied advice on the following matter by various students slightly older than me, so I post the question here in the hope to get an objective 'technical take' from experienced researchers.
Assuming that there are several topics which are equally attractive to me and that the prospective advisors are all established researchers in their fields and "nice people", are there any objective circumstances that I should take into consideration when searching for a topic for an undergraduate research project (clearly, this question naturally generalize to the choice of Ph.D. dissertation topics and general research advice, about which, if you please, you are free to elaborate) to maximize my chances of making an "optimal choice" (e.g., in terms of mathematical results achieved, possibility of getting a good recommendation afterwards, personal growth, etc.)? Clearly, referring to research papers in mathematical education that partially support your remarks will be highly appreciated (although it is not necessary).
Side note: Just to clarify a little further: I've only said that the mathematical aspects and the advisors are equal to me, and what I'm asking is what else I should take into account when choosing a research area.