It only becomes a problem when the second character is being written in a way that is contrary to their previously established character, and I wouldn't call the first character a Mary Sue because of it.
That's interesting--because I can think of times when I have--usually because it seems like Character A is only feeding lines to set up zingers from Character B. Even if it's not entirely OOC for Character A to say something stupid, if it becomes too much of a pattern so I expect any scene with Character B to have set ups like that, it becomes Sue-ish to me.
Really, when you think about it, it's just about suspension of disbelief, which is why some characters that see like totally MS's to some aren't to others and both of them can be right. It's mostly about the moment when you feel like the author isn't paying attention to the stories or the other characters and how they would really work because their priority is doing whatever they want to do with another character.
Not that fiction isn't always about manipulating things that way, but when you become aware of it or it feels fake it doesn't work.
So yeah, shitty writing definitely covers it too!
And also, you're totally right about comics, especially superhero comics. Pretty much everyone has to establish themselves as competent to be taken seriously at all, and in order to be competent against superheroes you have to be...really competent. I know there's a lot of times when people have been upset about one hero or another taken down at first that doesn't really bother me. If the heroes don't get beaten they can't rise up and win the day.