Every such railroad company shall have the right to purchase, take by voluntary gift or grant, acquire by condemnation, own, hold and use, all real estate and other property necessary for its corporate objects and purposes, and, when any property so acquired shall be no longer required for its use and purposes, to sell and convey the same.