Rankings themselves are not that important; most universities understand that they are biased and often poor indicators of what happens at a college or university.
One advantage of graduating from an undergraduate institution that is active in research is that the professors who write letters for you are more likely to be well-known by other researchers. If the reviewers don’t know any of your letter writers, your undergraduate degree is from a smaller or lower-ranked school, and you don’t have published research, your chances of being accepted into very competitive programs might be lower, because it will be harder to interpret recommendations from letter writers.