All railroad companies to which grants for rights of way through the public lands have been made by Congress, or their successors in interest or assigns, are authorized to convey to any State, county, or municipality any portion of such right of way to be used as a public highway or street: Provided, That no such conveyance shall have the effect to diminish the right of way of such railroad company to a less width than 50 feet on each side of the center of the main track of the railroad as now established and maintained.