Upon the filing of such petition in the district court, the judge shall set a date for a hearing, not less than forty days nor more than sixty days thereafter. It is the duty of the clerk of said court to cause a copy of such petition and a notice of the date and the time set for such hearing to be served upon the mayor of the town. The same shall be served at least thirty days prior to the hearing on such petition by the court. Upon the hearing and proof of the facts set forth in such petition, it shall be determined whether such tracts of land should be disconnected from said town, and the judge shall enter an order or decree accordingly. When a town has improved any of the highways passing through or adjoining said tracts of land by the construction and maintenance by said town of any special improvements along, under, or over the same for a period of more than two years prior to the presentation of the petition, the petitioners shall not be entitled to disconnect the land under the provisions of this part 7.