Tentative railway labor deal averts strike