After multiple failed attempts, Greenbrier Cos. (GBX 1.19%) finally has secured a deal to acquire rival American Railcar Industries. Given the troubles Greenbrier has had of late, the acquisition could not have come at a better time.

Greenbrier said on April 18 that it had a deal to acquire the manufacturing segment of American Railcar, or ARI, for $400 million from private equity firm ITE Management. The company, a manufacturer of hoppers, tank cars, gondolas, and other railcars in the U.S., Europe, and Brazil, has high hopes for the acquisition. Greenbrier expects the deal to contribute to earnings and free cash flow in the first 12 months after closing, and to give it a larger, more diversified operation.

A line of American Railcar-made hopper cars.

American Railcar hopper cars. Image source: American Railcar.

The deal comes at a difficult time for Greenbrier in particular and the railcar industry in general, as the stocks have been under pressure due to investor concerns over a weakening economy and the potential impact on the suppliers from shifts in the railroad industry. Greenbrier in particular has been plagued by weak results and concerns about its reputation in certain segments of the market.

If Greenbrier can integrate ARI successfully, the transaction would be a boon to it and its remaining independent rivals.

Third time's a charm

These two companies have a long history of interactions, so much so that Greenbrier CEO William A. Furman said management's code name for this deal was "Lazarus" because the idea has been brought back from the dead so many times.

Billionaire investor Carl Icahn, a major shareholder of ARI and its predecessor dating back to the 1980s, attempted to acquire Greenbrier in 2008 and then again in 2012. The two companies actually made competing offers for each other in 2012. They were rejected because neither company believed it was getting a large enough premium from the other.

There are good reasons why so many people have tried to bring these two businesses together. Merging Greenbrier and ARI combines the second- and third-largest North American railcar producers, vaulting the combination to within range of leader Trinity Industries (TRN 1.10%).

Greenbrier has historically specialized in mass production of standardized container cars, while ARI has a reputation for being able to efficiently handle small production runs of specialty cars. Greenbrier historically has focused on sales to railroads and lessors, while ARI's strength is selling to large shippers who own their car fleets.

An investor slide showing the complementary nature of the Greenbrier/ARI deal.

Image source: Greenbrier April 18 investor presentation.

Greenbrier manufactures from its headquarters in Portland, Ore., and from three sites in Mexico. ARI has two car manufacturing facilities in the U.S. Midwest, closer to a number of key customers, as well as three facilities making components that will allow Greenbrier to become more vertically integrated.

The companies expect to generate about $30 million in synergies from the deal, in part from more cost-effective component sourcing and from a reduction in transportation costs thanks to adding ARI's central U.S. manufacturing footprint. Post-deal Greenbrier would have greater exposure to the market for covered hopper cars -- made to transport dry bulk, plastic, and other materials that need protection from the elements -- and would be the dominant player in the manufacture of tank cars.

A much-needed boost

Greenbrier shares have been rolling downhill in recent years, declining 21% in the past 12 months, and its fiscal second-quarter projections offered little reason for investors to hop on board.

The company listed three broad factors for weak performance: a difficult environment in Europe, high labor costs, and weather-related closures at its repair facilities. Investors have also expressed concern that Greenbrier has been bleeding market share to Trinity, ARI, and others including FreightCar America.

Market share is important because there are trends in the rail industry that would suggest flat demand for new rail cars into the foreseeable future. The major North American railroads are at various stages of implementing precision scheduled railroading (PSR), an operating philosophy designed to improve efficiency in part by doing more with fewer resources.

Buying ARI should ease any concerns about market share and ensure Greenbrier has an ample order book regardless of how PSR might impact demand.

The 'buy' case is improving

In addition to scale, what ARI brings to Greenbrier is credibility. The company had a strained relationship with shippers that previously made it hard for Greenbrier to gain share in that market. ARI's inroads will help, and with gross margins trending downward in recent years, consolidating two of the three largest manufacturers should benefit the entire industry.

GBX Gross Profit Margin (Quarterly) Chart

Publicly traded railcar manufacturer Gross Profit Margin (Quarterly) data by YCharts

There are always risks in consolidation, and although Greenbrier and ARI know each other well, investors should watch carefully in the quarters to come to make sure there are no unexpected stumbles and that ARI is able to hold onto its customer base. But on paper this deal makes a lot of sense for the industry, and should help stabilize Greenbrier shares and help the company close the gap between itself and Trinity.

For investors with the risk tolerance to ride out a merger, it looks like a great time to jump aboard Greenbrier.