House votes to avert nationwide rail strike, bills heads to Senate