When a bridge is necessary over any creek or river that divides one county from another, the legislative body of each county shall join in an agreement for building, keeping, and repairing it, and the charge shall be defrayed by both counties in proportion to the number of taxable polls in each county.