The sefer חנוכת התורה here writes:
It is not clear what the end of the verse in Yeshayahu 57:1 - “because of the evil the righteous man has been taken away” means. It could mean that the righteous person is taken away to atone for the sins of the generation, or it could mean that he is taken away so that he does not live to see the bad thing that is going to happen to them.
But the correct interpretation can be learned by examining the situation. For example, if other righteous people are left alive then the first explanation must be correct - that he was taken away to atone for the sins of the generation. And if, for example, no righteous people were left alive, then it must be in order that they should not live to see the coming evil.
This is what Rashi means - Moshe thought that the correct explanation of the posuk was like the first interpretation, and therefore the decree of Hashem would be fulfilled by either himself or Aharon, since the death of one Tzaddik is be enough. But now that he saw that two of the sons of Aharon were taken away, it must be that the second explanation is the correct one, that they were killed so that they would not live to see the evil that would befall Yisrael, in which case all of the Tzaddikim of that generation should die. But since we see that only these two were killed, it must be that they were greater Tzaddikim than Moshe and Aharon, and therefore only they were fitting to be saved from seeing the evil that was to occur.
(I don't know exactly which coming evil is being referred to here)