This is a scary video!
According to the comments in the video, courtesy of Christian Base, VIA #41 was bound for Toronto when it rounded a bend on the CN Smiths Falls subdivision and discovered a CP local where it should not have been. The CP local had been working and had gone out onto the main without a clearance. Fortunately the VIA crew were alert and put the train into emergency and it was able to stop in time. Notice the crew bailed out just in case, and also notice the CP train went into reverse.
Rail safety... not just for people on the ground!