A. If the board of registration or the county clerk of any county does not cancel registration certificates as required by law, the secretary of state shall investigate the registration records, election returns and other pertinent records of that county and file a petition with the district court for the cancellation of the certificates of those persons as the investigation determines should have been canceled by the board of registration or the county clerk.

B. In such a proceeding, the court shall determine the cost of the investigation, and if it finds that the board of registration or the county clerk did not cancel certificates of registration in the manner provided by law, shall enter judgment against the county for the cost of the investigation.