All expenses incurred by any official or officer of any county in performance of duties defined by this subchapter and the costs of all elections held under the provisions of this subchapter shall be paid by the persons signing or filing the petition as provided in this subchapter, unless there is, in the opinion of the county judge, sufficient funds in the county general revenues, in which event the judge is empowered to pay all costs from these revenues, at his discretion.