MARHAURA, India—General Electric Co. could hardly have picked a less hospitable spot for its new locomotive factory—but then again, it didn’t have much choice.

The land here regularly floods in the rainy season, which meant work crews needed more than 500 truckloads of dirt a day to raise the parcel by more than 11 feet out of the danger zone. The facility required concrete pilings poured 82 feet below ground, on account of earthquakes.

When...