No railroad corporation shall close or obstruct any cattle pass or opening that has been used as a passageway for livestock across its right-of-way for a period of 5 years without having first secured the consent in writing of the abutting landowners.