Yukari's also never depicted wiping the floor with the main playable protagonists of the series. Sure, her implied powerlevel is over 9000 or whatever, but when was the last time she was shown actually defeating Reimu? Or Marisa? Perfect Memento and her official profiles make it clear that even when she loses, she acts like she's won (which ticks everyone off) implying that Yukari's never really trying when she loses, but Mary Sues generally... well, ACTUALLY win (as opposed to always lose, even if on purpose).
That and if we're compariing the mary sueness of Yukari vs the sisters... well, Silent Sinner had Yukari surrendering to Yorihime because she (according to Yukari, at least) had no chance against Yorihime in a fight. If Yukari's a Mary Sue, what does that make the character that Yukari surrenders to because she (so she says) doesn't stand a chance against as? The... um... Mary Sue Deluxe?
Well, that's just from a canon perspective. From a fandom perspective, a Mary Sue is typically a self-insertious character that all the other characters love and worship. So IMHO the fandom doesn't really Mary-Sue-ize Yukari that much because typically in fandom stories, every character hates Yukari. (yea, the fandom would have to be pretty bad to screw that one up, since Yukari being disliked by everyone is one of the most glaringly obvious and emphasized things in Touhou canon works about her)
(personal note: I'm not particularly bitter about that, myself, despite being a Yukari fan. Yorihime being invincible-ish is a necessary plot device for several things in the history of Gensokyo and Yukari, anyways, like those "hopeless boss fights" in RPGs. If the Lunarians weren't nigh invincible, Yukari wouldn't have been able to take advantage of that fact for some of her schemes. But taking SSiB by itself tho and... yea, Yorihime does look a bit Mary Sue-ish in her power)
On a side note, the "backstory" section of Yukari's section in the wiki isn't a word for word statement taken from any official source, by the way. The main actual canon statement regarding the war is from Perfect Memento.
Although she went in with an army of impudent youkai, they were crushed by the Moon's advanced weaponry.
It is believed because of that incident, youkai usually do not choose to attack outside their territory.
Sadly, Perfect Memento (nor any other source) doesn't say WHY Yukari invaded the moon. We do know that Yukari herself personally went, and that, for the most part, it seems the war resulted in the youkai choosing to not attack outside their territory.
The main question is if that was the intended effect. Fandom generally assumes that Yukari did this on purpose (IE, invaded the moon to get the youkai to stop attacking outside their territory), but it's never explicitly stated anywhere in the canon this was the case (tho it certainly is a valid speculation, and one that I personally believe is the case, myself). Also, in Cage in Lunatic Runagate, Yukari (apparently) reveals to Ran that she went to the moon by herself long ago (and is implied to be the first time she went to the moon. IE, before her invasion with the youkai army) and realized no invasion to the moon could ever win. Despite this, history shows she invaded the moon with an army anyways anyways. Logic would thus state that she never intended on winning in that first invasion because she knew she couldn't win.
...of course, that still doesn't answer the question of if she could have won if she tried. It just tells us that she knew (or at least believed she knew) she couldn't win yet invaded the moon anyways. Well, the lunarians have plenty of ways to nullify her abilities (such as the rope Yorihime ties her up with that's so thick and some other technobabble that you can't pass through via boundaries)
Yukari does seem pretty mad about the whole thing in SSiB (tho it's hard to tell how mad when she was pretending to be angry half the time. Angry Yukari = adorable, btw) and wants "revenge", however, it does seem that the whole 'revenge" she's shooting for is more "for the principal of the thing", so it doesn't necessarily contradict the idea that she lost on purpose (or rather, invaded knowing that she couldn't win on purpose). The fact that her entire revenge was basically just one fat trollicious prank seems to support that idea, IMHO.