No, Sonic doesn't die in Sonic X. He's simply teleported back to his home world of Mobius. And even setting that moment aside, he still doesn't die over the course of the series.