TORONTO—A cargo train carrying crude oil and liquefied petroleum gas derailed early Saturday in a rural area of Alberta, and three cars burst into flames, officials said. No injuries were reported but dozens of people were evacuated.

Canadian National Railway Co. said 13 of the 134 cars on the westbound train derailed about 1 a.m. local time in...