In NY city and state, many judges are elected. However, they are limited to members of the NY bar (min. 10 years practicing in NY). Primarily wanted to point out that "professional" and election-based are not mutually exclusive.
Source (PDF): http://www.nycbar.org/pdf/report/become_a_judge.pdf