BNSF Railway Co., the railroad owned by Warren Buffett’s Berkshire Hathaway Inc., plans to reduce capital expenditures for the first time in six years as railroads seek to rein in costs amid a freight slump.

The rail carrier said Tuesday that it will spend $4.3 billion, down 26 percent from a record $5.8 billion in 2015, on locomotives, rail cars, track and maintenance. BNSF had increased investment since 2010, which marked a six-year low of $2.7 billion.

The railroad joins Union Pacific Corp., CSX Corp. and Kansas City Southern in ratcheting down spending amid a drop in carloads, led down by coal. Total traffic for large U.S. railroads fell 2.5 percent last year and the declines have continued in the first two weeks of 2016, according to data from the Association of American Railroads.

BNSF, the largest North American railroad by carloads, came under fire from customers and regulators in 2014 after surging crude-oil cargo, a record grain harvest and harsh winter conditions caused service to deteriorate. In reaction, the railroad pumped up spending by almost 50 percent to $11.3 billion in 2014 through 2015 from the previous two years.

The investment has paid off. BNSF’s train speeds have recovered and the railroad has added new express routes. BNSF’s total traffic fell 0.1 percent last year, compared with a 5.9 percent decline for Union Pacific and 4.9 percent for Kansas City Southern’s U.S. operations, according to AAR data.

“Our railroad is in the best shape it has ever been,” BNSF Chief Executive Carl Ice said in a statement. “While our customers’ demand outlook has softened in a number of sectors, regular maintenance of our network continues to drive the majority of our annual investments and helps ensure we continuously operate a safe and reliable network.”

BNSF’s capital expenditures last year were slightly lower than the company’s original target of $6 billion.

Union Pacific plans to spend $3.75 billion this year, down from $4.2 billion last year, and CSX is shaving $100 million off last year’s $2.5 billion. Kansas City Southern said it plans to spend between $580 million and $590 million, down from $649 million last year.