India is an incredibly diverse place, which many, many local languages and dialects. I know the early Mughals spoke Persian, but was there any attempt to standardise and impose a language throughout the empire?
No. The idea of a "national language" was one that was quite foreign to states of days gone past. Frankly, even in India today, there has been very little serious effort to impose a national language. About the closest thing to a national language in India is Hindi, and even then 43% of Indians do not speak it. Pakistan has had, more success in imposing Urdu, although it can be hazarded that this is because only a small number of Pakistanis speak it as their first language, so it is not an issue that gets tied up in regional pride. Even then, the decision to exclude Bengali (which in 1947 was by far the most spoken language in Pakistan), was a major reason for the secession of East Pakistan.
In any case, premodern states did not need such a thing, as the ability to communicate with each other is only a concern for educated citizenry, which is an inapplicable concept to the Mughal Empire, a state entirely lacking citizenry. Throughout the Mughal Empire, most administrative tasks of the central government was done in Persian (or later, Urdu), but most Mughal (and for that matter British) administration happened through local intermediaries like Zamindars and local Princes, who might administer only several dozen villages. This low level nobility (or their translators) would have had some degree of fluency in Persian or Urdu; they were the primary people responsible for collecting taxes and sending them to Delhi.
National languages are something of a recent imposition in most places. Most people in Germany spoke primarily dialekt until about 50-70 years ago. Standard French was only imposed in that country about 150 years ago, and Francicization was only totally complete by like, World War II. The Russian Empire had dozens of Russian dialects, with an English speaking Imperial family and French speaking nobility until the Soviet era.