A New York company and two utilities have a cost-effective solution to the nation’s aging underground infrastructure: a robot that crawls through cast-iron natural-gas pipelines and replaces their deteriorating joints, effectively renewing the pipes for up to 50 years.