Canada ends railway shutdown that could have disrupted US economy