Section 36. The governor, with the advice and consent of the council, may from time to time, upon the petition of the aldermen or the selectmen of any town within the judicial district of a district court, except a town in which the clerk of such court resides, designate and commission a justice of the peace residing in such town to take bail in criminal cases arising within said judicial district.