Though I watched IA a while ago, I think my memory serves to praise IA more than The Departed.
I am assuming that the Matt and Andy characters wanted to turn "good" which was the reason they killed their mob boss and mole colleagues. They no longer wanted to be bad guys so they killed the only people who knew they were not who they pretended to be. While watching The Departed, you don't exactly know that's going through Matt's character's mind. But when you come to think about his scared-sounding talk with Jack Nicholson, his stammering and promising he'll take care of things, then you see it.
The part where Jack Nicholson's group wanted to find the mole within his group, it seemed kinda unusual they didn't suspect Leo's character more than they did. Sure, an older guy who's been in the organization longer could've suddenly turned (although we don't know the length of anyone's membership save for Jack's main guy). But my first inclination would be to suspect the new guy Leo. And no amount of "I'm not the mole" would satisfy me.
But why was Jack Nicholson's character also an informant? Was that right? Ah, the movie was too long and my interest, and my energy, just waned by the conclusion.