A New York City subway train came off the rails Friday — its second derailment incident in a month, the city’s transit agency said.