In a closely watched election contest, San Francisco voters have upheld a first-in-the-nation ban on the sale of menthol cigarettes and other flavored tobacco products, overwhelmingly rejecting an $11.6 million campaign by R.J. Reynolds to scuttle the law.