Even without the holy words of our sages who told us this [i.e., that pious gentiles merit olam ha-ba], we would know this from our intellect because “God is just in all His ways and benevolent in all His deeds.” We see that many pious gentiles recognize the Creator, believe in the divinity of Scripture, act compassionately toward Israel, and some have done great things for entire world. The pious [Edward] Jenner invented the vaccine that saves tens of thousands of people from disease [namely, smallpox], death and disability. [Sir Francis] Drake brought the potato to Europe, which has prevented famine on several occasions. [Johannes] Guttenberg invented the printing press.
Some of them never received their reward in this world, like the pious [Johannes] Reuchlin who risked his life to prevent the burning of the Talmud, which had been commanded by Emperor Maximilian in 1509 due to the incitement of the apostate [Johann] Pfefferkorn, who made an evil accord with the priests. Reuchlin exerted every effort to oppose this and convinced the Emperor to retract this decree. Due to this, his enemies the priests pursued him and made his life bitter until he died under pressure with a broken heart.
Could you imagine that these great deeds will not be rewarded in olam ha-ba? God does not withhold the reward of any creature. Even if you say that these pious ones who keep the seven Noachide commandments would not have the status of a ger toshav (resident alien) because they never made a formal acceptance before a court or because we do not accept gerei toshav in our day, since they do not act like Esau, they have a portion in olam ha-ba.
R. Yisroel Lipshutz, author of "Tiferes Yisrael" on the Mishnah
https://www.etzion.org.il/en/philosophy/issues-jewish-thought/rabbinic-thought/r-lipshutzs-attitude-towards-non-jews