The Gemara in Bava Metziah 86b writes slightly differently and does not state that Raphael went to save Lot, but rather Gavriel:
The Gemara continues: Who are these three men? They are the angels Michael, Gabriel, and Raphael: Michael, who came to announce to Sarah that she was to give birth to a son; Raphael, who came to heal Abraham after his circumcision; and Gabriel, who went to overturn Sodom. The Gemara asks: But it is written: “And the two angels came to Sodom in the evening” (Genesis 19:1). The Gemara answers that Michael went along with Gabriel to Sodom to save Lot. The Gemara notes: The language is also precise, as it is written: “And he overturned those cities” (Genesis 19:25), and it is not written: They overturned those cities. Conclude from it that only one angel overturned Sodom. (Sefaria translation)
Either way, Tosafos over there helps provide an answer:
ההוא דאתא לשזביה ללוט - ותימה דאמרינן בבראשית רבה (פרשה נ) דאין מלאך אחד עושה שתי שליחות ויש לומר דכאן לא עשה מיכאל בשליחות אחת כי אם מעשה אחד שבישר את שרה וכשהלך משם לסדום אז הותחלה שליחות אחרת ודוקא במקום אחד אין עושה ב' שליחות ובב"ר (שם) יש שרפאל בא להציל את לוט ורפואת אברהם אינה נזכרת ואפילו בא כמו כן לרפואת אברהם חשיב הכל שליחות אחת דרפואה והצלה ענין אחד הוא הקשה הר"ר אלחנן הא משמע לישנא דקרא ששניהם הצילוהו כדכתיב (בראשית יט) ויחזיקו האנשים בידו וכתיב ויוציאוהו ויניחוהו מחוץ לעיר וכתיב בתריה שאמר ליה מלאך שבא להפוך את סדום כי לא אוכל לעשות דבר עד באך שמה ויש לומר ששניהם הוציאוהו חוץ לעיר ומיכאל הלך עמו עד צוער וגבריאל היה מצוה אותו למהר
He who went to save Lot - This is wondrous/a question, since it says in Bereishis Rabbah that a single angel does not do two tasks. We must therefore say here, that Michoel performed only one task when he came to bring the news to Sarah. And when he went from there to Sodom, then a new mission began; i.e. it is specifically in one place that an angel does not perform two tasks. In Bereishis Rabbah it says that Raphael came to save Lot, and the healing of Avraham is not mentioned. And even if Raphael came also to heal Avraham, this would all still be considered a single task, because healing and saving are considered the same matter.
Rabbi Elchanan asks: It is implied from the verses that there were two angels involved in saving him (Lot). As it writes: “And the men held his hand,” and it writes “they took him out and placed him outside the city.” And later it says that the angel that came to overturn Sodom said to him, “I will not be able to do a thing until you get there (to Tzo’ar).” So we have to say that both of them (Michael and Gavriel) took him out of the city; Michael escorted him to Tzo’ar and Gavriel commanded him to hurry. (my translation)
So if we learn like Rashi's p'shat that Raphael both came to heal Avraham and save Lot there are two answers:
Either, it is only in one place that an angel performs his set task - and so when he went to save Lot it was a new place and therefore a new task.
Or, both tasks were one of the same, namely an act of saving / salvation. So Raphael first alleviated Avraham's pain and then saved Lot.