TORONTO (Reuters) - Canadian National Railway Co (>> Canadian National Railway Company), the focus of fresh scrutiny after one of its trains derailed and caught fire last weekend, reported a market-beating third-quarter profit and record revenue on Tuesday, as it announced a two-for-one stock split and share buyback plan.

The country's largest rail operator, which maintained its 2013 profit and spending forecast, said revenue was lifted by higher freight volumes due to strong energy demand, market share gains and a North American economic recovery.

"We had a slow start in June and July, from a revenue standpoint, but all revenues rebounded nicely in September," Chief Executive Claude Mongeau said on a conference call.

"More important than that, we were able - throughout the quarter - to continue to outpace base market conditions. That helps us deliver solid top line growth," he said.

Big efficiency gains helped as the railway handled more cars with the same amount of workers and staff, for example, and moved cars more quickly through railyards.

CN's closely watched operating ratio improved by 80 basis points to 59.8 percent in the quarter. The ratio measures productivity by tallying how much revenue is required to maintain operations - the lower the number, the better.

NEW BUSINESS

CN said it has lured some sizeable intermodal, or container, contracts away from rival Canadian Pacific Railway (>> Canadian Pacific Railway Limited).

Shipments from Chrysler (>> Fiat SpA) will start next summer in the province of Ontario and business will begin in January with Hong Kong's Orient Overseas Container Line (OOCL). CN said it also won contracts from container shipper APL Ltd, a subsidiary of Singapore-based Neptune Orient Lines Ltd (>> Neptune Orient Lines Ltd.) and liner carrier MOL in 2013.

CN expects its fourth-quarter results will also get a lift from a record Western Canada and strong U.S. grain crop, along with healthier housing starts, auto sales and energy markets.

At an investor conference last month, Mongeau said he expects CN to run 70,000 cars of crude-by-rail this year and double that volume next year.

The boom in demand for railway shipment of crude shows no sign of slowing, as North American oil output swells while existing pipelines remain congested and new projects are delayed by environmental opposition and regulatory issues.

Still, CN's October 19 derailment has pushed rail safety and fuel transport regulations back to the top of Canada's agenda.

While no one was hurt, it revived still-raw memories of a runaway train carrying crude oil that derailed and exploded in the middle of Lac-Megantic, Quebec in July, killing 47 people.

Emergency braking was deemed to be behind the derailment of CN's propane and crude oil cars in Alberta, the Transportation Board of Canada said on Tuesday.

An explosion and fire that followed forced some 100 people from their homes, but they have now returned, Mongeau said.

HEADWINDS TO COME

"Looking ahead to the fourth quarter, keep in mind that we expect some headwinds," said Chief Financial Officer Luc Jobin.

Stock-based compensation and benefits for a former executive could add up to C$30 million, he warned, while pension expenses should add up to C$100 million this year.

Contract talks, which recently broke down between the Teamsters union and CN, resumed Monday with a government-appointed mediator. A Teamsters Canada Rail Conference spokesman told Reuters that the union was optimistic negotiations will produce a deal this week.

If talks fail, there is the possibility of a strike or a lockout by October 29. The Teamsters represents some 3,300 conductors, trainmen, yardmen and traffic coordinators.

BETTER-THAN-EXPECTED PROFIT

Net income rose to C$705 million ($685 million), or C$1.67 per share, in the quarter, which ended September 30, from C$664 million, or C$1.52 per share, in the same period last year.

On an adjusted basis, profits rose to C$1.72 per share from C$1.52 per share. Analysts were expecting a profit of C$1.63 a share, according to Thomson Reuters I/B/E/S.

Revenue rose 8 percent higher to C$2.7 billion.

The Montreal-based railway reaffirmed its January forecast, for high-single-digit growth in earnings per share over 2012.

Shares of CN, which reported after markets closed, finished down 15 Canadian cents at C$109.75 on the Toronto Stock Exchange. The stock has climbed more than 20 percent in the year to date.

The company will spend up to C$1.4 billion to repurchase up to 15 million shares under its buyback program and said its stock split will take place on November 29.

($1 = $1.0285 Canadian)

(Reporting by Susan Taylor and Solarina Ho; editing by Richard Chang and G Crosse)

By Susan Taylor and Solarina Ho