Investors in Canadian National Railway Company (TSX:CNR)(NYSE:CNI) were in for a pleasant surprise when the transportation company announced its second-quarter results earlier this week. Expectations were low, with some analysts even projecting an outlook downgrade. Canadian National not only pulled off a strong quarter, but also maintained its full-year guidance.

So what’s driving the company? Here are the top five highlights from the earnings report, and what that could mean for the stock going forward.

1. What’s hurting its top line?

Canadian National’s top line is clearly under pressure — it remained flat in Q2. Revenue from Intermodal, the company’s largest segment, improved only marginally. Meanwhile, grains and fertilizers and metals and minerals – which together make up more than 25% of the company’s sales – saw revenues decline 7% and 5%, respectively.

While coal and energy markets are unlikely to improve anytime soon, low grain volume is proving a big dampener especially after last year’s record crop year. However, these are largely uncontrollable factors that are hurting railroad players across the board. What’s important is whether Canadian National can maintain its margins in such situations.  Fortunately, we have good news here.

2. Pulling the brakes on expenses

Despite flat revenue, Canadian National’s Q2 operating income jumped 8% year over year backed by lower fuel and labor costs. Its operating margin shot up to 44% during the quarter.

Thanks to lower expenses, the company’s operating ratio — a key measure of efficiency for railroads that compares operating expenses to its net sales — improved three percentage points to 56.4% during Q2. That’s impressive, because a lower ratio indicates greater ability to sustain profits when revenue growth is slow. In fact, Canadian National looks better poised than rival Canadian Pacific Railway which reported a much higher operating ratio of 60.9% for its second quarter.

3. Profits on growth track

Marked improvement in its operating ratio boosted Canadian National’s Q2 net income by nearly 5% year over year. That explains why the company could silence its critics and affirm its guidance despite a challenging business environment. Canadian National earned $3.85 per share in 2014 and is targeting double-digit growth in EPS this year, which should be a record.

4. Eye on the future

Canadian National plans to shell out $2.7 billion on capital projects this year. The breakup looks something like this:

  • Roughly $1.4 billion for revamping track infrastructure for higher safety
  • $500 million for purchase of new locomotives
  • Remaining for improvement of yards, terminals, and distribution centers.

The key takeaway: Canadian National has all-round growth plans in mind, which should help it build a solid foundation for the future.

5. Greater rewards to shareholders

Canadian National’s free cash flow remained well above the $1 billion mark for the first half of the year, confirming the company’s strong financial standing. The company already has an ongoing share repurchase program in place, and it increased its annual dividend by a whopping 25% earlier this year.

The good news is that investors can expect greater returns in the years to come, as the company reiterated its target 35% dividend payout ratio during Q2. It currently pays only about 28% of its profits as dividend.

Going by Canadian National’s solid Q2 report, there’s no reason why its operating ratio and profits shouldn’t improve this year. The company clearly wants to reward shareholders, and there’s nothing better that you would want to hear.

Want to earn more in hefty dividends?

These three top stocks have delivered dividends for shareholders for decades (and even centuries!). Check out our special FREE report: "3 Dividend Stocks to Buy and Hold Forever". Click here now to get the full story!

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Neha Chamaria has no position in any stocks mentioned. David Gardner owns shares of Canadian National Railway. The Motley Fool owns shares of Canadian National Railway. Canadian National is a recommendation of Stock Advisor Canada.