SAN FRANCISCO—Democrats here are assured victory in the November election to replace outgoing U.S. Sen. Barbara Boxer because the contest features two Democrats—a first under the state’s new election system which sends the top two primary vote-getters to the general election, regardless of party affiliation.

But as the state’s Democratic establishment has lined up to support one candidate, Kamala D. Harris, the state’s attorney general, against her challenger, U.S. Rep. Loretta Sanchez, the campaign has divided the party in...