When it is necessary in the construction, reconstruction, alteration, or improvement of its railroad, or in making additions to or relocating such railroad, to cross a road or a stream of water, a railroad company may divert it from its location or bed, but without unnecessary delay it shall place such road or stream in such condition as not to impair its former usefulness.