CP Rail reaches deal with union