Whenever any public record is restored, as provided in this chapter, all court costs and necessary expenses of restoring the same shall be paid by the county to which said records belong, whether said action is commenced or prosecuted by a county official or by the owner of any real estate authorized to maintain such action.