Actually this is, imo, one of the easiest parts of this Hungarian Rhapsody, which, again in my opinion, is possibly the most difficult of all 19 Hungarian Rhapsodies. I don't mean to sound cruel, but are you entirely sure you're ready to play the rest of this piece if you can't play a melodic line beneath a sustained trill? I hate sounding so direct, but the truth is, this piece has much more devillish tricks in store for you than that.
Well, anyway, to get to the matter at hand, all you have to do is play the trill with a fingering perhaps something like: 2-3-2-4-2-3-2-4 (or maybe just 2-3 or just 2-4, or even 3-4 if you want) and play the melody with the thumb. The obvious difficulty is in accenting the melody, while keeping IT at piano, and also keeping the trill at a dynamic level below that, so as to avoid overpowering the melody with the trill. So, make sure the focus is on your thumb, and for the trill your focus should be on a light, smooth touch. It is a backdrop for the melody and should never come into the foreground. When the melodic note repeats the trill note, as with the Bbs and Dbs, all you do is start the trill, on the first beat of the measure, then start it again on the first upbeat, giving it an accent to bring out the melodic note in each case (and dropping immediately back down to the trill's natural volume of, say, pp). To work on the evenness of the trill, as well as dynamic control, work on it in different rhythms, always at the softest possible dynamic level, and then add the thumb, perhaps at a violently exaggerated marcato, in order to best emphasize the dynamic contrast between the parts, and give your fingers more control once you can play it as written.
Or was there a more specific problem you had in mind? Are you actually studying the piece, or did you just want to know about that specific passage? Similar passages can be found in La Campanella, too, if you're interested, among many other pieces by Liszt and other Romantic composers. In fact, the technique is employed again in HR12 on page 134 of the Dover edition (after a sempre vivamente tempo marking, about 15 measures later) in Db, using exact rhythms. And by the way, I've never played this piece myself, and although I have played through all of the Hungarian Rhapsodies at one time or another (not all at tempo (some not even close) or with 100% accuracy, good Lord...), this one being the sole exception. It is simply too hard, and I feel it is not worth the effort.
One should either be a work of art, or wear a work of art.
You know, some people just have natural talents-like some people play the piano but aren't very tall.