The other defeated candidate was State Sen. LeAnna M. Washington - charged in a corruption case in March - who lost to Arthur Haywood, a Cheltenham Township commissioner in a tight three-way battle in the Fourth Senatorial District.
Washington, 68, was charged by the Attorney General's Office with using taxpayer-paid staff to throw a lavish campaign fund-raiser. She has denounced the charges.
While Washington and Miranda face trials, four other state legislators ran Tuesday under an ethical cloud, although none has been charged with a crime.
The four - State Reps. Vanessa L. Brown, Michelle Brownlee, Louise Bishop, and Ronald G. Waters - accepted money in 2010 and 2011 from an undercover operative in a sting investigation run by the state Attorney General's Office, according to sources and investigative documents. The probe was inherited by state Attorney General Kathleen G. Kane, who shut it down last year as poorly managed.
Brown was the only one of the group to face a primary challenge, and she soundly defeated her two opponents.
A day after Miranda's arrest, the seven Democratic ward leaders in the 197th District endorsed Acosta, a teacher and former contracting officer for the military.
The other candidates were Ben Ramos, who represented another North Philadelphia district in the state House from 1994 to 2000, and Danilo Burgos, founder of the Dominican Grocers Association of Philadelphia. Each won about 20 percent of the vote.
No Republican filed in the primary in the district, which should assure that Acosta will win the fall general election.
Washington was running in a district that includes parts of Philadelphia and Montgomery County.
Along with the challenge from Haywood, she faced opposition from Brian Gralnick, also of Cheltenham.
With all votes counted, Haywood held a substantial lead over Washington, and Gralnick was running a distant third.
Gralnick ran neck and neck with Haywood in Montgomery County, but lagged his opponents in Philadelphia.
Washington, a lawmaker for two decades, was battling in the face of a grand jury presentment that said she had cursed out an former aide who complained about her use of taxpayer money to campaign.
"I am the f- senator, I do what the f- I want, how I want, and ain't nobody going to change me," it said she told the aide.
Haywood, 57, is a former Community Legal Services lawyer who works as a solo practitioner representing nonprofit organizations.
Haywood will face Robin Gilchrist in November. Gilchrist ran unopposed Tuesday in the Republican primary.
Of the four Democratic state representatives who allegedly took money in the sting, Bishop, 80, has denied taking money from informant Tyron B. Ali. Brownlee, 57, said she could not recall accepting anything from him. Waters, 64, said he might have received something from Ali for his birthday.
Brown, 47, has declined to comment, but through her lawyer has denied any wrongdoing.
Of the four, only Brown faced opposition in the primary. And as no Republican was on the primary ballot in any of the four districts, the outcome of the fall election seems a foregone conclusion.
Brown's primary opponents in the 190th District were Wanda Logan and Isaac Patterson V.
Patterson, an education advocate making his first run for office, said in a recent interview that Brown should have stepped down before Tuesday's election.
"If she was a woman of any class or decency, she would resign her position," he said.
Elections aside, the four still face considerable jeopardy in the months ahead.
The legislature has begun an ethics investigation of them. Among the possible outcome of such an inquiry would be votes to reprimand them or even expel them.
On top of that, the Philadelphia District Attorney's Office has obtained the sting investigative file from state prosecutors and is evaluating the evidence to see if prosecutions might be warranted.