Local voters favored US Representative Ed Markey in Tuesday’s special election to replace John Kerry in the US Senate by a wider margin than the statewide results, according to results from the city clerk’s office. The Democrat from Malden received about 60 percent of the votes cast by city residents, while Republican candidate Gabriel Gomez, an investment banker and former Navy SEAL from Cohasset, was chosen on nearly all of the remaining ballots. Twelve Visions Party nominee Richard Heos received 31 votes, and 22 ballots went to write-in candidates. Across the state, Markey finished with approximately 55 percent compared with 45 percent for Gomez. Waltham saw a 27 percent turnout Tuesday, when 9,344 of the city’s 34,000 eligible voters showed up at the polls.