House passes deal to avoid rail strike, vote moves through to Senate