Just something as simple as encouraging the adoption of language Y at home, and encouraging (not necessarily forcing) its use in schools, the media, etc. should do the job.
In China, the government is already tying to stifle the use of Cantonese (the second-most widely spoken language after Mandarin), by restricting Cantonese-language TV channels. I think actions like that go too far, and especially wouldn't recommend it in India, where ethnic tensions would flare up quickly were the government to even think of doing something like this.
They should rather just make it so that switching will be the sensible thing for the vast majority of people. If Hindi gains predominance in the STEM fields, humanities, and in other places, it will be natural for people to learn it and eventually start using it at home.
For instance, the vast majority of Americans are not of English ancestry by any means[1]. In fact, the largest ancestries are German and Irish. I imagine, most of these immigrants eventually picked up English and transitioned to using it at home at some point. I've also read German was even spoken in small pockets (e.g. in Pennsylvania) until the early 1900s. Can you imagine what the US would've been like, if every immigrant group decided to retain their language and identity?
[1] https://en.wikipedia.org/wiki/American_ancestry#Ancestry