Nati Harnik, Associated Press
In this Friday, June 6, 2014, photo, an employee performs maintenance on the tracks in front of a Union Pacific train in Council Bluffs, Iowa. Union Pacific’s second-quarter profit declined 7 percent as the railroad hauled 6 percent less freight overall and coal volumes plummeted 26 percent, the company reported, Thursday, July 23, 2015.

OMAHA, Neb. — Union Pacific's second-quarter profit declined 7 percent as the railroad hauled 6 percent less freight overall and coal volumes plummeted 26 percent.

Rival railroad CSX said last week that faltering demand for coal would slow profit growth this year and in April, natural gas overtook coal as the top source of U.S. electric power generation for the first time ever, according to the U.S. Department of Energy.

Falling natural gas prices and the potential for more restrictions on the use of coal by environmental regulators have curtailed its use and that has weighed on railroads.

Union Pacific reported $1.2 billion in net income, or $1.38 per share. That's down from $1.29 billion, or $1.43 per share, a year ago.

The Omaha, Nebraska, railroad said Thursday that its revenue fell 10 percent to $5.4 billion because its price increases couldn't offset the drop in volume.

While profits beat Wall Street expectations by three cents, revenue fell short of analyst projections for $5.6 billion, according to a poll by FactSet.

Shares of Union Pacific Corp. fell slightly in premarket trading.

The railroad's share repurchases over the past year boosted its earnings per share. Union Pacific said the number of shares outstanding declined 3 percent to 875 million.

President and CEO Lance Fritz said the railroad has made good progress working to reduce costs to match the lower freight demand.

"We will continue to reduce costs and improve productivity as we further align resources with demand," Fritz said.

There were only a couple areas where quarterly shipping volume increased for Union Pacific. Automotive shipments increased 7 percent and the number of intermodal containers the railroad hauled grew 2 percent.

Along with the coal declines, shipments of industrial products fell 13 percent and agricultural shipments fell 7 percent.

Union Pacific operates 32,400 miles of track in 23 states from the Midwest to the West and Gulf coasts.