The chief DA is elected in Texas. The police chief isn't elected but works for the Mayor/City Council. Many judges are elected and others are appointees. Differences in local politics and structure exist, but IMO it is fair to say that those positions are political.
>>and must appeal to the masses.
As to GP's assertion that those people must appeal to "the masses", I think that one must be very careful as to how they define "the masses"; to me "masses" is not the correct word since IMO there is usually a much smaller faction of the local population(s) of people that vote, and/or are active in local politics.