Section 7G. Whenever, in connection with the laying out, widening, relocating, constructing or altering of a public way by the department, land or an easement therein owned by a public utility company is taken by the department by eminent domain under chapter seventy-nine, thereby necessitating the relocation of the facilities of such company, the department may acquire by purchase or otherwise or take by eminent domain under chapter seventy-nine such land or easements therein as such company may designate for the relocation of such facilities, and convey the same to such company. Such conveyance shall be in lieu of any damages for the value of the land or easements therein of such company so taken by the department, not including, however, any damages for the cost of such relocation for which the commonwealth may be liable.