Which is more important when applying to grad school (particularly top grad schools): Research or Letters?
Short answer: In practice, letters are more important.
Long answer: Doing great research is great, but if I'm on an admissions committee, how do I know your research is great? I can read your paper, but unless it's close to my area of expertise, it can be hard or at least time-consuming to determine its quality. I probably have too many applicants who wrote a paper to read everyone's paper in detail (depending on how common undergraduate authorship is in my field). And even if I'm convinced the paper is great, how do I know what your contribution to the paper was? (In the fields I'm familiar with, it's very rare for undergrads to author solo papers.) On the other hand, if I have a letter from a faculty member whose word I trust saying that this paper is great and you did most of the hard work (or even that he/she is very impressed with your potential), that's much more useful.
"Yes."
If you were asked to pick one, really either one is extremely helpful for getting into graduate school. Great letters will speak to your potential as a researcher, and great research shows it fairly concretely - but as has been noted, it may be hard to recognize research quality outside of a particular subfield. In my field however (public health) there are some broad strokes measures of quality that someone can pick out. And if we're talking about publications, that's rare enough in my field to be an unusual entry on someone's CV.
Moreover, I'd suggest that this dichotomy is something that likely won't exist, especially if you do great research. A good letter discussing that research, cementing its contribution in the admission committee's mind and setting it up as "a preview of things to come" should follow pretty naturally.