House passes bill to avert rail strike