Amid the rolling mountains surrounding this quiet town in southwest New York state, tucked away on miles-long stretches of underused rail tracks, hundreds of idle oil tank cars attest to the extent of fallout from oil's rout.

The oil tank cars - a year ago sought-after to haul crude from North Dakota to New Jersey - now stand idle as a result of two converging trends: the reversal in U.S. shale oil production and the completion of new pipelines.

They show how the pain from the slump in the oil-by-rail industry has spread far and wide.

Big rail lines, such as Berkshire Hathaway-owned BNSF Railways or Union Pacific are losing what used to be their fastest-growing source of new traffic; refiners such as PBF Energy are left with millions of dollars worth of unused rolling stock; and leasing firms such as Trinity Industries and Greenbrier Companies Inc have seen monthly rates fall to a third of peaks above $2000 per car.

There is one winner, though.

Short-line railroads from Utah to Pennsylvania are making millions of dollars every month by providing refiners, producers and traders a place to park their unused tank cars.

Outside this town of 14,000, along sidings that once helped ship vast volumes of coal, lumber and other raw materials during the region's industrial heyday, the Western New York and Pennsylvania Railroad is now collecting fees for about 800 cars.

"They've been here for about five months, and we hear rumors more are coming," Carl Belke, chief operating officer for the line, told Reuters.

WNY&P's main rail line is about 190 miles (306 km) long. By comparison, BNSF has 32,500 route miles in 32 states.

Gennessee and Wyoming, the nation's largest short line rail road, is collecting as much as $5 a day on each of about 2,000 idle crude rail cars in Utah, the Midwest and Canada, according to chief commercial officer Michael Miller.

The company is also storing up to 700 frac sand cars, as plummeting oil prices have pushed production into reverse for the first time in five years. Demand has been rising since late last year, accelerating further in the past three months, Miller said.

Reading Blue Mountain & Northern Railroad and the North Shore railroads in Pennsylvania are also storing cars, according to company officials. Neither company would provide specific numbers.

To be sure, the extra revenue offsets only some of the income lost because of a drop in traffic caused by declining coal use and slowing crude shipments.

"We'd much rather be moving cars than storing them," Miller said.

Still, rail car storage is a fast-growing business. In addition to oil traffic decline, tens of thousands of cars may need to be retrofitted or replaced to meet tough new safety regulations.

"Clearly, the number of cars being displaced over the coming months exceeds the existing capacity for storage," Todd Cecil, vice president at Chicago-based Iowa Pacific Holdings said in a July news release announcing its storage expansion plans.

The short rail company also said it already had three unit trains in storage in Colorado and was planning to use its tracks in upstate New York, along with others, to capitalize on demand for up to 50,000 cars that it expects to come off the tracks as the new rules are phased in.

Imports And Pipelines

Short line railroads have traditionally served as a temporary storage hub for underused rail cars, particularly in regions where industry has shut down or scaled back.

"Simply, they have the space," Barton Jennings, a professor of supply chain management at Western Illinois University, said. "Many of these short lines have a one or two customers and they can utilize their sidings for storage. Also, they are located at the beginning or end of a trip, so it makes sense."

Crude shipments by rail soared to 1.1 million barrels per day (bpd) in December 2014, or more than a tenth of total U.S. production, from 20,000 bpd in 2009, but volumes have been falling since the start of this year, according to the data from the U.S. Energy Information Administration. (Graphic:http://link.reuters.com/xag55w)

Some of the decline may reflect lower demand from refiners such as PBF, which found it cheaper to import crude this year than to haul it by rail from North Dakota, where most traffic originates.

While the firm has invested in new facilities to allow its two East Coast refineries to unload up to 210,000 bpd of crude oil from rail cars, it only ran about 60,000 bpd in the second quarter, less than its contractual amount, CEO Tom Nimbley told investors last month. Shipments are set to fall to as little as 40,000 bpd this quarter.

Rival refinery Phillips 66 has also cut oil-by-rail shipments.

"We actually set cars on the siding. We brought imported crudes in the system," CEO Greg Garland recently told investors.

In addition, construction of several new pipelines from North Dakota to a major storage facility in Cushing, Oklahoma, has been completed, providing a cheaper alternative for shippers and further reducing demand for tank cars.

For the first time since 2012, pipeline shipments from North Dakota are due to overtake exports by rail, state data shows. If the slump in shipments and tank car glut persists companies could consider scrapping some cars, though analysts say it is unlikely.

"It's too big of a write off," said Taylor Robinson, president of PLG Consulting, which works with crude by rail firms."They will hold on to them and hope things improve. These are 30-40 year assets."