Whenever the Secretary of the Interior shall deem it to be consistent with the public interest he is authorized to lease deposits of oil and gas in or under lands embraced in railroad or other rights of way acquired under any law of the United States, whether the same be a base fee or mere easement: Provided, That, except as hereinafter authorized, no lease shall be executed hereunder except to the municipality, corporation, firm, association, or individual by whom such right of way was acquired, or to the lawful successor, assignee, or transferee of such municipality, corporation, firm, association, or individual.