Given this past week's quarterly results from North America's railroad companies, it would be easy to presume the worst. Union Pacific (NYSE:UNP) reported a 24% decline in freight revenue. CSX (NASDAQ:CSX) saw operating income slide 37% lower year over year. Canadian Pacific Railway (NYSE:CP) seemed to fare slightly better, topping earnings estimates of 3.77 Canadian dollars per share for its second quarter. It was a dubious victory though. The bottom line of CA$4.07 per share was down from earnings of CA$4.30 for the same quarter a year earlier, while the top line fell 9%.

In short, the superficial picture is grim. Shares of each of these three railroad stocks suffered following their respective quarterly reports, unwinding a small part of the rebound each of these stocks made after hitting a major low in April.

As it turns out, however, those who have bought these names since April's bottom have the right idea. While last quarter's results were indeed ugly, the timing of each of these quarters was incredibly unlucky. The rail business has improved dramatically since these quarters ended.

Tanker cars lined up on a rail line

Image source: Getty Images.

In the meantime...

All three of the quarters in question ended in June, which means they started in early April. While the coronavirus outbreak made landfall in continental North America in late February (it is believed), it wasn't until mid-March that consumer-facing companies started to shutter their doors. Factories and production facilities didn't follow suit in earnest until April. Those closures increased as calendar Q2 marched on.

Translation: With little being manufactured, mined, or milled that required delivery, it's no surprise that demand for rail freight slumped.

Investors have every reason to expect markedly improved third-quarter numbers from rail carriers like Union Pacific and Canadian Pacific, though. While it's impossible to see just from the full-quarter numbers, demand for rail freight started to rebound in the middle of the second quarter. It's greatly improved since Q2 officially ended.

The Association of American Railroads provides weekly updates of how many carloads are ferried across the nation's railways. Intermodal numbers (the big boxes that can also be stacked up on ship and flatbed truck trailers) are posted, too. As would have been expected, cars and intermodal traffic disintegrated into a mid-March lull. Things picked up slightly in April, but tanked in a big way again in late May. That's when rail traffic started to perk up in a big way.

For the week ending on July 18, rail traffic reached a level not seen since February. Mexico and Canada have taken a similar path, first into weakness, and then back out of it. Union Pacific, CSX, and Canadian Pacific all play a role in that international freightage too.

The American Association of Railroads' data says carload traffic is rebounding from a COVID-19 lull

Chart used with permission from American Association of Railroads.

Clearly total rail traffic remains below 2019 and 2018's levels. But, that's not necessarily the end of the world. It's recovering rapidly, but it's still a recovery from some rather severe damage.

Derailing is still possible, but not likely

It's an encouraging sign, particularly considering the COVID-19 outbreak is accelerating again. A revival of March and April's shutdown orders could make it difficult for consumers to purchase goods, or for factories to produce them. That will crimp the need for rail delivery.

That prospect somehow seems less likely the next time around, though. Consumers and companies have figured out how to work around the coronavirus rather than simply submitting to shutdowns. People are also plenty bored, creating demand regardless of COVID-19 headwinds.

Whatever's in the cards, don't sweat last quarter's early, disappointing numbers from the rail transportation industry. Things have drastically improved in just the three weeks since the quarter ended, and were already on the mend a month before the quarter came to a close.