Sanskrit never disappeared from Indian history; the significance of the language has changed.
Follow up on the explanation to get more details:
Sanskrit was never stopped during the period of the Mughals, but the importance of Sanskrit changed. In India, Sanskrit was proposed as an important language for religion, education, and science. When the Mughals were in rule, they made sure that the Persian language became the main language of administration and literature. Due to these changes, the use of Sanskrit in government and elite sectors declined.
However, Sanskrit was used by the Hindu scholars, temples, and regional kingdoms. Powerful Akbar played a significant role in keeping the Sanskrit knowledge alive. He was the only king who helped and motivated the translation of the Sanskrit into Persian, religiously translated perspectives such as the Mahabharata (translated as Razmnama) and the Ramayana. Akbar gave invitations to Hindu and Jain scholars to his court to talk and discuss how they can preserve the traditions of India.
After the death of Akbar, new Mughal rulers like Jahangir and Shah Jahan were not interested in the knowledge of Sanskrit studies, but they were more likely interested in art and architecture. During Aurangzeb’s rule, the optimal support for Hindu institutions was stopped, but the locals kept on teaching in places like Jaipur, Varanasi, Mithila, and South India.
At the end of the Mughal rule, Sanskrit was no longer the language of power. After all this, it remains important as a sacred and scholarly language. Sanskrit also encouraged Persian and Urdu through translations and carried on to Hindu religious and cultural life.