If a railroad company fails to fence its line where it adjoins a public road or street, or lies so near as to render travel on it dangerous, the governing body of the town or municipality having charge of the road or street, by notice as in the case of an abutting landowner, may require the fence to be built. In case of failure to build the fence within the time provided in section 219.33, the town or municipality has the rights and remedies given by section 219.33 to an abutting owner.