Unions, MTA reach LIRR agreement after Cuomo steps in