A district may construct any works along, under, or across any stream of water, watercourse, street, avenue, highway, railway, canal, ditch, or flume which the route of a pipeline or canal of the works may proceed along or across in a manner that will afford security for life and property. The district shall restore the property crossed as near as may be to its former state or so as not to have impaired unnecessarily its usefulness. Every company whose railroad is crossed by the works shall unite with the district in forming the crossing and shall grant the necessary privileges.