What happened

Business has been lumpy for railcar manufacturers, but some stocks are bucking the downtrend. Shares of FreightCar America, Inc. (RAIL -2.25%) shot through the roof last month to gain a whopping 31%, posting their best monthly performance in several quarters. In sharp contrast, shares of rival American Railcar Industries, Inc. (NASDAQ: ARII) lost 15.5% in May to hit 52-week lows.

American Railcar's fall isn't really surprising given the company's muted quarterly earnings report that it released in early May. FreightCar, however, neither delivered a stellar earnings report nor announced anything big. So why did its shares surge?

So what

FreightCar reported its first-quarter earnings on May 3, earning only about $0.6 million in net income versus $12.7 million in Q1 2016, on 6% lower revenue. It's worth noting that FreightCar benefited from a substantial one-time gain related to retiree benefit obligations during its first quarter last year. However, even on an adjusted basis, FreightCar's Q1 profit came in almost 45% lower year over year at $2.9 million. American Railcar's numbers were no better -- its Q1 revenue slumped 35% and net profit more than halved to $10.6 million on low shipments.

Rail tracks

Image source: Getty Images.

Blame low demand from railroads and shippers, which has hurt players across the board. Sluggish coal and oil markets, in particular, have hit railroads and shippers in recent years, compelling them to scale back capital spending and railcar purchases.

There's one area, though, that's benefiting FreightCar, American Railcar, and nearly every other railcar manufacturer: a strong lease market. American Railcar's railcar leasing revenue improved 3% in Q1 as the company expanded its lease fleet by nearly 12% year over year to 11,869 cars. Likewise, FreightCar delivered 100 leased cars in Q1 compared to none in the year-ago quarter.

There's no bigger evidence of the strength in the leasing market than the results from the largest railcar manufacturer in North America, Trinity Industries (TRN 1.57%). Much like FreightCar and American Railcar, Trinity reported a sharp slump in its rail group revenue for the first quarter. Trinity's railcar segment, however, turned out to be the strongest as the company's total leased railcar number grew 8.5% year over year to 105,455 cars as of March 31. More important, Trinity expects to expand its lease fleet further this year, reflecting its optimism about the market.

American Railcar is clearly beating FreightCar in the lease game, having expanded its fleet aggressively in recent years:

Chart showing the growth in American Railcar's lease fleet and revenue since 2012.

American Railcar's lease segment data. Image source: American Railcar.

Comparatively, FreightCar had only 440 railcars in its lease fleet as of March 31. There's another number worth noting: Of American Railcar's backlog of 3,286 railcars as of March 31, 37% will go to its leased fleet, reflecting the company's intent focus on leasing.

Now what

Undeniably, a pickup in demand for railcars is required to put manufacturers back on the growth track. Unfortunately, end-market conditions are expected to remain challenging in the near future as major railroads are still cautious about large spending, especially on fleet. This graph from Trinity's May investor presentation is a pretty bleak illustration of projected industry railcar deliveries through 2020.

North America railcar delivery projection through 2020.

Image source: Trinity Industries.

Of course, a recovery in coal, oil, and other markets could lift growth prospects for railcar manufacturers, but it's still too early to say when that'll happen. Meanwhile, it's apparent that companies that can exploit leasing opportunities to the maximum will stand to gain. Between FreightCar and American Railcar, the latter is clearly better positioned in this regard.

Given the backdrop, FreightCar's strong run-up in May comes as a surprise, and I don't see any reason other than a possible short squeeze given the 10% drop in the stock's short interest between April 28 and May 15. Otherwise, FreightCar's dismal Q1 numbers do not justify the rally in its stock price, and I wouldn't be surprised if the stock gives up its gains.

American Railcar also delivered a bummer of a first quarter, but its focus on leasing should help it ride out the storm. The company has also been free cash flow positive in the past couple of years, unlike FreightCar. And with shares trading at 11 times trailing earnings and a dividend yield of 4.5%, I think investors could even consider American Railcar's recent drop a good opportunity for long-term investing.