Any person, corporation, or company holding a lease within Yellowstone Park for the purposes described in section
32 of this title is authorized, with the approval of the Secretary of the Interior, to execute mortgages upon his or its rights, properties, and franchises, including his or its contract or contracts with the Secretary of the Interior, and such mortgages, together with the approval of the Secretary of the Interior may be filed for record in the office of the Secretary of the Interior, and when so recorded shall have all the effect of a public record. Any mortgage, lien, or encumbrance created under the provisions of this section shall be subject to the rights of the Government to compel the enforcement of the terms of the lease or contract of the mortgagor, and any purchaser under a foreclosure of such encumbrance shall take subject to all the conditions assumed by the original lessee or contractor.