X has an office in Bengaluru that does engineering, so leaving India would be non-trivial.
Also Modi is an elected popular leader. India's censorship laws have been passed through the normal means. If Musk pushed back most Indian institutions would rally against him.
de Moraes is a chief justice making decrees that it's not clear he has the power to make. He's doing it in an unhinged fashion. Getting out of the country until things cool down is probably the smart move.