NEW DELHI—Japan's prime minister and India's president sat side-by-side on the reviewing stand here on Sunday as India celebrated a national holiday with a parade designed to display military strength.

It was an important show of solidarity between Asia's largest democracy and its richest as the two nations contend with an increasingly assertive, well-armed and authoritarian China.

The...