The episode where Shadow goes after Cosmo is episode 73 of Sonic X. That's the one you're looking for.
If you're rewatching to catch the moment, jump straight to that installment and you'll find the confrontation you're after.