What happened?

The stock prices of leading railroads CSX Corporation (NASDAQ:CSX) and Union Pacific Corporation (NYSE:UNP) rose strongly in November, with the former increasing 9.3% and the latter up 10.5% on the month. While it's easy to get too focused on the granular detail, the reality is the whole transportation sector was taken higher in November.

As you can see below, most of the move happened in the last week of the month. Furthermore, the strength in transportation stocks has been broad-based, with package delivery firms, airlines, trucking, and railroads sharing in the gains.

CSX Price data by YCharts

These kinds of synchronized stock moves indicate a change in investor sentiment toward the sector, and that might be for a number of reasons.

Optimism on global growth, and in particular, prospects for the U.S. as CSX and Union Pacific are heavily focused on the domestic economy.

Leading indicators of the industrial economy have remained positive and suggest good growth going forward -- railroads have heavy exposure to industrial conditions.

Optimism on President Donald Trump moving forward with his infrastructure spending plans.

As you can see below, U.S. industrial production has bounced back nicely in 2017. A widely followed indicator of U.S. manufacturing conditions, the Institute for Supply Management's Purchasing Managers Index (PMI), is indicating strength, while the PMI new orders index suggests growth prospects are improving -- a reading above 50 indicates growth.

ISM Purchasing Managers Index data by YCharts

So what?

It's usually not a good idea to read too much into one week's trading, but there's little doubt that prospects look good for the railroads in 2018. Both companies have plans to cut their operating ratios in the coming years -- a key metric in the railroad industry that measures operating expenses against revenue -- and any improvement in end-market conditions is likely to drop into the bottom line in terms of increased profitability.

That said, it only really matters if the economy improves as expected and there is a boost in infrastructure spending. Earnings from both companies have provided early evidence of the industrial recovery in 2017, so if the recent stock movements are anticipating a strengthening economy, then investors can expect improved outlooks from both companies in the near future.

Now what?

Wait and see. The strength in the transportation and railroad sector and leading indicators are suggesting the fourth quarter will be a good one for CSX and Union Pacific, and ultimately set the railroads up for a strong 2018. Both have made operational improvements this year; now it's time for the economy to lend a hand.