Railroad operator Kansas City Southern (KSU) - Get Report on Friday reported second-quarter earnings that beat analysts' forecasts as the company focused on improving efficiency of its chemical and petroleum shipments, particularly to Mexico.

The Jacksonville, Fla.-based freight company said it earned adjusted net income of $164.7 million, or $1.64 a share, vs. net income of $144.5 million, or $1.54 a share in the comparable year-ago quarter.

Analysts polled by FactSet had been expecting earnings of $1.61 a share. Revenue came in at $714 million, above the $706.5 million expected by analysts.

Revenue growth for the second quarter was led by a 19% increase in chemicals and petroleum shipments to Mexico, thanks to energy reform initiatives, and a 5% increase in automotive.

The increases were partially offset by revenue declines in energy related shipments including coal, fractures sand and crude oil.

"The company is handling the same volume as last year with fewer assets, fewer crewstarts and considerably less network congestion, driving an improvement in customer service, operating metrics and cost profile,"  CEO Patrick Ottensmeyer said in a statement. 

The results followed the likes of Union Pacific (UNP) - Get Report  and JB Hunt (JBHT) - Get Report , who this week also reported better-than-expected second-quarter earnings, indicating ongoing strength in the transportation sector. 

Shares of Kansas City Southern were up nearly 3% at $121.39 in early trading on Friday. They ending the day Thursday up 1.03% at $117.99.