Any mortgagee of the property and franchises of any railroad corporation may become the purchaser of the same at any sale thereof under the mortgage, upon foreclosure by advertisement, or under a judgment, or decree, or otherwise, and hold and use the same, with all the rights and privileges belonging thereto or connected therewith for the period of six months, and convey the same to any railroad corporation.
N.Y. R.R. Law § 151