Railroad stocks may not have had a great year in 2018, but better to blame the broader market sell-off for their weak performance than the railroads themselves. Most companies in the sector, in fact, delivered impressive operational numbers through the year thanks to brisk activity in commodity markets -- particularly energy, coal, and chemicals -- and tight trucking capacity that boosted intermodal volumes for railroads.

CEOs of leading railroads expect the tailwinds to spill over into 2019. While you'd want to look out for potential hiccups like trade tensions, there are enough reasons to remain bullish on railroad stocks like Canadian National Railway (NYSE:CNI), CSX (NASDAQ:CSX), and Union Pacific (NYSE:UNP).

Speeding up growth

2018 will go down in Canadian National Railway's history as a year when it displayed its agility at its best. When operational challenges hit the company earlier in the year, it swiftly initiated aggressive actions to win back both consumer and shareholder confidence. CN ousted its CEO, urged incoming CEO Jean-Jacques Ruest to "act with urgency," fast-tracked a massive expansion program, and spent record sums of money on equipment and infrastructure to boost capacity, all within a span of a few months.

CN's last quarterly numbers revealed the fruits of its labor, when management boosted its fiscal 2018 adjusted earnings guidance by roughly 4% at the midpoint to 5.30 to 5.45 Canadian dollars per share. For context, CN earned CA$4.99 in adjusted EPS in 2017.

A freight train.

Image source: Getty Images.

CN's operating ratio -- which measures a company's total expenses relative to its revenue and is better if lower -- rose nearly 2.8 percentage points to 61.6% through the nine months ended Sept. 30, 2018. That was, however, because of capacity and workforce expansion, which isn't a bad thing. Moreover, even with a higher operating ratio, CN was among the most cost-efficient railroads in the U.S. (A rival surprisingly toppled CN on this front recently -- more on this later.)

With 27 capacity expansion projects coming online in fiscal year 2018, CN has positioned itself well to capitalize on its unparalleled three-coast network and take advantage of strong markets in 2019 and beyond. The stock's 10% drop in 2018 is, therefore, a good opportunity.

Carrying forward a leader's vision

CSX was in a tough spot when it entered 2018, having just lost CEO Hunter Harrison to an untimely death at a time when it was chalking out big growth plans under the leadership of the veteran who, during his lifetime, turned around railroads like Canadian National and Canadian Pacific.

Harrison, however, had set the ball rolling during his one-year stint at CSX by launching a "precision scheduled railroading" operating model that focuses intently on key metrics like train velocity that can hugely boost productivity and cut costs, as CSX's CEO James Foote explained on a recent conference call.

Foote is carrying Harrison's vision forward successfully, as is evidenced in the dramatic improvement in CSX's operating ratio to 60.3% during the nine months ended Sept. 30, 2018, from 69.6% in the comparable period last year. CSX's total expenses, in fact, declined 8% during the period despite 7% higher revenue. CSX's cash flows have visibly taken off since the implementation of the model in 2017.

CSX Cash from Operations (TTM) Chart

CSX Cash from Operations (TTM) data by YCharts.

Cost control should help CSX maintain its operating ratio at around 60% and grow cash flows in the medium term. For patient shareholders, that could also mean higher dividends -- CSX increased its dividend by 10% in early 2018 -- adding to the several reasons why CSX could outperform in 2019.

The right focus at the right time

If CSX lost Hunter Harrison, Union Pacific just got a shot in the arm for a reason distantly related to Harrison.

On Jan. 7, Union Pacific announced the appointment of Jim Vena as its chief operating officer. Vena served as the COO at Canadian National Railway until retiring in 2016. The big news is that Vena was with CN for 40 years, and that includes the years when Harrison led the company. (Remember, I told you earlier that Harrison played a big role in turning CN's fortunes around.)

Not surprisingly, the market welcomed Vena's appointment and sent Union Pacific shares soaring as much as 8%. Yet even with those gains, Union Pacific shares are trading at par with rivals on a price-to-cash-flow basis of around 14 times.

UNP Price to CFO Per Share (TTM) Chart

UNP Price to CFO Per Share (TTM) data by YCharts.

As it is, Union Pacific has one of the strongest cash flow profiles in the industry, having doubled its operating cash flow in the past 10 years. The company also raised dividend by 10% last July, increasing total dividends by nearly one-third in a year's time.

Things may only get better from here for one big reason: Union Pacific recently took a page out of CSX's playbook and launched a program called the Unified Plan 2020 with focus on precision scheduled railroading. Meanwhile, it expects fiscal 2018 operating ratio to be 62.7%. That's flat when compared with its 2017 ratio, but Union Pacific noted how carloadings in December exceeded expectations and productivity improved under its Unified Plan 2020. With Vena set to head the program now, Union Pacific may have just stepped closer to achieving its medium-term operating ratio target of 60%, making it a great stock to own now.

Check out the latest Canadian National Railway, CSX, and Union Pacific earnings call transcripts.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.