By Diego Oré

Mexican President Andres Manuel Lopez Obrador appeared to confirm the agreement later in the day, saying he did not know if it had been signed yet but that he believed the terms were beneficial for both parties.

"A good deal was reached," the president said.

The agreement does not include cash compensation, the sources also said, but rather the expansion of expiring concessions.

Last week, Lopez Obrador said had Grupo Mexico had requested 9.5 billion pesos ($534.41 million) as compensation.

In mid-May, Navy troops seized a 128-kilometer railway section controlled by Grupo Mexico Transportes in the Gulf state of Veracruz.

Lopez Obrador said the measure was necessary for "security reasons" and that the line was vital for one of his top infrastructure projects.

"The agreement involves the expansion of concessions set to expire," said one of the sources, who requested anonymity as they were not allowed to speak on the matter, without giving further details.

The other source added that Lopez Obrador would give more details on the agreement in the next few hours.

Grupo Mexico did not immediately respond to a request for comment.

($1 = 17.7767 Mexican pesos)

(Reporting by Diego Ore; Addditional reporting by Lizbeth Diaz; Writing by Kylie Madry; Editing by Anthony Esposito, Brendan O'Boyle and Diane Craft)