An oft-repeated cliché holds that a rising tide lifts all boats. In this case, it's true for a railroad as well. Hauling all of those suddenly valuable commodities boosted Canadian National Railway's (NYSE:CNI) fourth quarter to the tune of 15% revenue growth. Assuming an average exchange rate of 0.792 for the quarter, CN posted revenue of nearly $1.4 billion and EPS of $1.02 -- beating the $0.97 Wall Street estimate.

Commodities were key to CN's great quarter, and six of the company's seven commodity groups showed gains for the quarter, the lone exception being automobile shipments. Coal, timber products, and ores were all particularly strong with each group posting greater than 20% annual growth for December.

CN not only hauled a lot more cargo in December but also hauled it more profitably. Operating margins for December climbed to 35% from 34% a year ago, despite a 29% increase in fuel prices. Cash generation was also strong; the company posted more than $800 million in free cash flow for the year, up more than 75% over last year's tally. Choosing to spread the wealth, CN announced a 28% dividend hike -- the ninth straight year that the company has raised its dividend.

CN is well-positioned to continue to take advantage of the cyclical commodity boom. First, Canada is undeniably rich in a wide range of natural resources. What's more, the country is huge, and much of its resources are in far-off places that are not always easily served by trucks or seagoing vessels.

Trading at just more than 16 times trailing earnings, CN looks like it's priced in line with its peers. Looking deeper, though, CN's shares begin to seem like more of a bargain. Despite being one of the largest railroads in North America, CN boasts exceptional margins and a strong return on equity that is well above the industry average. With strong performance and no apparent drop in the demand for commodities on the horizon, Fools might want to try riding the rails with Canadian National.

The Fool has been working on the railroads. Check out this other articles:

Fool contributor Stephen Simpson holds a CFA. He has no ownership interest in any stocks mentioned.