and for the elimination of hazards and the installation of protective devices at railways-highway crossings, and (2) a bridge replacement and rehabilitation program shall be administered as if apportioned under chapter 1 of such title and shall remain available through September 30, 2022: Provided further , That the funds made available under this heading for activities eligible under section 133(b)(1)(A) of title 23, United States Code, and for the elimination of hazards and the installation of protective devices at railway-highway crossings, shall be apportioned to the States in the same ratio as the obligation limitation for fiscal year 2019 is distributed among the States in section 120(a)(5) of this Act: Provided further , That, except as provided in the following proviso, the funds made available under this heading for activities eligible under the Puerto Rico Highway Program and activities eligible under the Territorial Highway Program shall be administered as if allocated under sections 165(b) and 165(c), respectively, of such title and shall remain available through September 30, 2022: Provided further , That the funds made available under this heading for activities eligible under the Puerto Rico Highway Program shall not be subject to the requirements of sections 165(b)(2)(A) or 165(b)(2)(B) of such title: Provided further , That the funds made available under this heading for the nationally significant Federal lands and tribal projects program under section 1123 of the FAST Act shall remain available through September 30, 2022: Provided further , That the Secretary shall distribute funds made available under this heading for a bridge replacement and rehabilitation program to each qualifying State by the proportion that the percentage of total deck area of bridges classified as in poor condition in each qualifying State bears to the sum of the percentages of total deck area of bridges classified as in poor condition in all qualifying States: Provided further , That the funds made available under this