A widely followed Indian stock index advanced to a record Tuesday, extending a rally fueled by foreign cash.

The S&P BSE Sensex gained 0.5% to end at 39056.65, breaking through its previous closing high, hit in August. Just a month ago, the benchmark stood as one of the region’s worst performers of 2019.

The Nifty 50, another popular gauge...