Look, India still lags far behind China, it faces risks of Pakistani extremism, it needs further economic reforms, and it too readily accepts inefficiency as the natural order of the universe. India’s education and health system is a disgrace, especially in rural areas; Bangladesh does a much better job, despite being poorer. But change is in the air in India. Infant mortality is dropping, voters are pushing for better governance, and I think India has three advantages over China in their economic rivalry in the coming decades.

First, India’s independent news media and grass-roots civic organizations — sectors that barely exist in China — are becoming watchdogs against corruption and inefficiency. My hunch is that kleptocracy reached its apogee and is now waning in India, while in China it continues to get worse. I’ve written scathingly about India’s human trafficking and oppression of women, but it’s also true that civil society is addressing these issues.

Second, China’s economy may be slowed by the aging of its population, while India’s younger population will lead to a “demographic dividend” in coming decades. (Indian overpopulation is still a problem, but the average woman now has 2.6 children, and the figure is dropping.) Likewise, China already reaped the economic advantages of empowering its women, while India is just beginning to usher the female half of its population into the formal labor force.

Third, India has managed religious and ethnic tensions pretty well, aside from the disgraceful anti-Muslim pogroms in Gujarat in 2002. The Sikh challenge in the Punjab has dissipated. Muslims have been president of India three times, and are prominent in business and the movie industry; perhaps as a result, India has the world’s third-largest Muslim population (after Indonesia and Pakistan) but few jihadis. And while India has sometimes behaved brutally in Kashmir, civil society watchdogs are pressing for better behavior there. In China, by contrast, tensions with ethnic Tibetans and Uighurs are worsening.

China’s autocrats are extraordinarily competent, in a way that India’s democrats are not. But traveling in India these days is a heartening experience: my hunch is that the world’s largest democracy increasingly will be a source not of embarrassment but of pride.