Any telegraph or telephone company now organized or which may hereafter be organized under the laws of this or any other state shall have the right to construct, maintain and operate lines of telegraph or telephone along and upon the right-of-way of any railroad in the state, and to that end is granted all powers for the exercise of the right of eminent domain; provided, the ordinary travel or use of said railroad is not interfered with by reason thereof; and provided further, that no pole shall be erected nearer than 20 feet from the outer edge of the track, unless by the consent of the railroad company.