NEW DELHI—India’s economic expansion accelerated to the fastest pace in nearly two years, pulling further ahead of rival China in the race to be the world’s fastest-growing economy, as the effects fade from the government’s crackdown on cash and adoption of a new tax.

Gross domestic product in Asia’s third-largest economy grew 7.7% in the three months through March compared with a year earlier, according to government data issued Thursday. That was better than economists’ prediction of 7.4% and stronger than the 7% expansion...