A deal was reached to end the Long Island Rail Road strike that affected hundreds of thousands of commuters in New York.