General Electric Co. is in danger of losing one of its largest industrial contracts after a political shake-up in India, highlighting the risk of the conglomerate’s chase to win business in far-flung markets by investing heavily in local operations.

GE won a $2.5 billion deal in 2015 to sell diesel locomotives to Indian Railways—delivering 1,000 of the machines over 11 years—using a structure the company said would be a model for the future. In exchange for a massive order from one of Asia’s biggest economies, GE would agree...