Whenever the track of a railroad crosses another railroad or a highway, such railroad or highway may be carried under, over, or on a level with the track, as is most expedient. Where an embankment or cutting necessitates a change in the line of such railroad or highway, the corporation may take such additional lands and material as are necessary for the construction of the road or highway on the new line. If the necessary lands cannot be had otherwise, they may be condemned as provided in Title 7, Part 3 of the Code of Civil Procedure, and when compensation is made therefor the lands become the property of the corporation.