CN Rail says safety is its top priority, as train service resumes following a derailment on the edge of a suburban residential area northeast of Montreal.