Democrats claim first statewide office since late ’90s with judge switch