DUBAI—Ebrahim Raisi, a hardline judge who is under U.S. sanctions for human rights abuses, secured victory as expected on Saturday in Iran’s presidential election after a contest marked by voter apathy over economic hardships and political restrictions. With all 28.9 million ballots counted, Raisi was elected with a tally of 17.9 million, Interior Minister Abdolreza Rahmani Fazli said on state TV. Turnout in Friday’s four-man race was a record low of around 48.8 percent and there were 3.7 million invalid ballots that were likely to have been mostly blank or protest votes. Appointed by Supreme Leader Ayatollah Ali Khamenei to the high-profile job of judiciary chief in 2019, Raisi was placed under U.S. sanctions a few months later over human rights violations. Those included the role that human rights group say Raisi played in the executions of thousands of political prisoners in the 1988 and in the violent suppression of …