Mary Sue is hardly limited to always being a goody two-shoes. This brand of Mary Sue decided to take the evil path, dropkicking a few dogs and probably laughing like a maniac about it in the process. Whether it be stealing the Cosmic Keystones out of the heroes' grasp, effortlessly bringing about the ironic utopia of the other villain, or just generally acting like a psycho, they absolutely love to be evil.
This character generally shows up as an author's wish fulfillment to be evil. Alternatively, in fanfiction, it might show up because the author favors the villain. Or the fan-created insert-villain is just so much better and more powerful than the canon villain, who quickly becomes the Villain Sue's henchman/woman (if not instantly and easily disposed of). It might be a consequence of Evil is Cool, taken to the logical extreme. Or, perhaps, the author just has a distaste for some (or all) of the protagonists and created the character to facilitate a Hate Fic, Fix Fic, or Revenge Fic. Either way, the same author favoritism and plot bias are now working for the forces of evil. It may also come about as an attempt to create a Magnificent Bastard or similar style of villain, only to go too far and become one of these.
As far as overlaps go, there are two major ones. Sympathetic Sue is an easy one where the intent is to show that the character just had a bad enough life to be forced into villainy. With this overlap, they are more of a Villain Protagonist than an antagonist in most cases. Tends to show up most often in fanfiction. Expect the backstory to either be so extreme as to be a Deus Angst Machina or so laughably weak in comparison to their evil acts that it makes them Unintentionally Unsympathetic. The other common overlap is the God-Mode Sue, with a ridiculous power level, forcing the heroes to hold the Idiot Ball, and/or requiring Deus ex Machina in order for the protagonists to stand a miniscule chance of defeating them. This is the type that generally shows up in Canon. It can overlap with other types, such as Jerk Sue, as well, but it never overlaps with Purity Sue (although they might become one after the Heel–Face Turn, once the plot forgets everything evil about them).
Probably the rarest type of Sue, as villains are already generally given great powers and abilities to be a more credible threat to the protagonists and make their inevitable downfall more sweet. A true Villain Sue has to go the extra mile in being more powerful than the heroes, usually by never having that inevitable downfall, and they may even win over the heroes, completely and utterly destroying them and undoing all their efforts—and even if they do lose, it may be via Only the Author Can Save Them Now rather than any non-Ass Pull method. In some cases, Villain Sue can be justified, for example if the villain is an Eldritch Abomination and the plot revolves around a Cosmic Horror Story.