Hoping to avert a rail strike, U.S. House votes on union agreement