An inventor in 19th-century New York had been dreaming about a subterranean railway for decades. He’d have to break a few rules to build it.