Foreign investment is allowed up to 49% of the capital of Mexican companies granted a concession for the construction, operation and exploitation of railroads or the provision of rail freight and passenger transport services. Full ownership may be authorised subject to the approval from the National Foreign Investment Commission.
"ARTICLE 2.- For the purposes of this Law, it shall be understood as: [...]
II.- Foreign investment:
a) The participation of foreign investors, in any proportion, in the capital stock of Mexican companies;
b) That carried out by Mexican companies with a majority of foreign capital; and
c) The participation of foreign investors in the activities and acts contemplated by this Law.
III.- Foreign investor: to the natural or legal person of a nationality other than Mexican and foreign entities without legal personality;
[...]
ARTICLE 3.- For the purposes of this Law, that made by foreigners in the country with the condition of Permanent Resident stay is equated to Mexican investment, except for that carried out in the activities contemplated in Titles One and Two of this Law.
ARTICLE 4.- Foreign investment may participate in any proportion in the capital stock of Mexican companies, acquire fixed assets, enter new fields of economic activity or manufacture new product lines, open and operate establishments, and expand or relocate existing ones, except for the provisions of this Law.
The rules on the participation of foreign investment in the activities of the financial sector contemplated in this Law shall be applied without prejudice to what is established in the specific laws for those activities.
For purposes of determining the percentage of foreign investment in economic activities subject to maximum participation limits, foreign indirect investment will not be counted, is carried out in such activities through Mexican companies with a majority of Mexican capital, provided that the latter are not controlled by foreign investment.
[...]
ARTICLE 8.- A favorable resolution of the Commission is required for foreign investment to participate in a percentage greater than 49% in the economic activities and companies mentioned below: [...]
XII.- Construction, operation and exploitation of railways that are a general means of communication, and provision of the public rail transport service. [...]" (Foreign Investment Law (27 December 1993), last amended on 15 June 2018, Articles 2, 3, 4 and 8 [google translation])
------------------------
"Article 7. A concession is required for:
I. Build, operate and exploit railways, which are a general means of communication. [...]
II. Provide the public rail transport service.
[...]
Article 17. Concessions will only be granted to Mexican legal entities.
Foreign investment may participate up to forty-nine percent in the capital stock of the concession companies referred to in this Law.
A favorable resolution from the National Foreign Investment Commission will be required for the investment referred to in the preceding paragraph to participate in a higher percentage. Said Commission shall consider, when resolving, that regional and technological development be fostered, and the sovereign integrity of the Nation be safeguarded.[...]" (Railway Law (12 May 1995), last amended on 6 November 2020, Articles 7 and 17 [google translation])
Foreign Investment Law (27 December 1993), last amended on 15 June 2018, Articles 2, 3, 4 and 8 
Railway Law (12 May 1995), last amended on 6 November 2020, Articles 7 and 17
[<a href="http://www.diputados.gob.mx/LeyesBiblio/pdf/44_150618.pdf">Law</a>],[<a href="http://www.diputados.gob.mx/LeyesBiblio/pdf/209_061120.pdf">Law</a>]