The train stopped while the driver freed a sheep that had got stuck in a fence.