In the event such telegraph or telephone companies should fail, upon application to such individuals, railroads, companies, to secure such right-of-way, by consent, contract, or agreement, then such telegraph or telephone corporations shall have the right to proceed to procure the condemnation of such property, lands, rights, privileges, and easements, in the manner prescribed by law for taking private property for works of internal improvement.