BANGALORE, India—In the past two days, Amazon.com Inc. and local rival Flipkart Internet Pvt. have both made billion-dollar bets that online shopping is poised to take off in India, the world's second-most-populous country.

Amazon said Wednesday that it would invest $2 billion to expand its India operations, a day after Flipkart, India's biggest homegrown e-commerce company, said it had raised $1 billion from backers to help it grow.

...