; and (2) the extent to which the project or activity will mitigate risk factors associated with rail transportation of flammable liquids or gases, including reducing risks to— (A) public safety; (B) the environment; and (C) public or private property. (e) Non-Federal share (1) Maximum federal share Notwithstanding the limitation set forth in section 20105(e) of title 49, United States Code, the Federal share of project costs under this section may be up to 90 percent. (2) Method of payment The non-Federal share of project costs under this section may be paid in cash or in kind from a grantee or a private entity involved with the project. (f) Agreements As a condition of awarding any grant under this section for a project that uses rights-of-way owned by a railroad, the Secretary shall require that a written agreement exist between the applicant and the railroad regarding such use. 8. Authorization of appropriations (a) High hazard rail shipments preparedness and training grants (1) In general There is authorized to be appropriated $15,000,000 in each of the fiscal years 2020, 2021, and 2022 for grants authorized under section 5116(a) of title 49, United States Code, for the purposes described in paragraph (1)(D) of such subsection. (2) Availability Of the amounts appropriated pursuant to paragraph (1)— (A) the amounts appropriated for fiscal year 2020 shall remain available until September 30, 2021; and (B) the amounts appropriated for fiscal year 2021 shall remain available until September 30, 2022. (b) Track relocation and railroad inspection safety grants There is authorized to be appropriated $25,000,000 in each of the fiscal years 2020, 2021, 2022, and 2023 for grants authorized under section 7.