Amanda* makes pastries to sell around the streets of Quito, she is not a detective. But the day after she buried her youngest daughter she “started to move” to track down those responsible.

Carolina Andrango had promised her mother she would not run away again. The 15-year-old had been through a difficult two years. She had fallen in with a bad crowd, her school grades had dropped and she had spent time in a drug rehabilitation clinic. She’d gone missing from home for days at a time. But on a shopping trip in August, it felt like happier times. Her mother bought her a new backpack and Carolina fooled about with her older sister, making a video on her phone.

Then Carolina got a phone call from a boy asking her to come out to eat salchipapas (hot dogs) in the Comité del Pueblo neighbourhood where they lived in the north of Quito, the Ecuadorean capital.

Excited, Carolina pleaded with her mother to let her go. Amanda was worried, but reasoned her daughter was getting back on the right track. Reluctantly, she agreed. “Make sure you’re back in an hour and a half. Be careful, don’t trust the people around you,” she told Carolina.

“Trust me, Mami, I know how to defend myself,” Carolina said.

“She hugged me and gave me a kiss on the forehead,” Amanda recalls. It was 25 August 2018.

“Trust me, Mami. I’ll be back,” Carolina had said.

The following day Carolina’s body was found dumped on a patch of wasteland. She had been gang-raped and strangled.

On Monday in Quito, a 17-year-old boy, who cannot be identified for legal reasons, was convicted of rape resulting in death and sentenced to eight years’ detention. He was also ordered to pay $4,000 (£3,192) to Carolina’s family. Later this year, a man is due to face trial in connection with Carolina’s death and is also expected to be charged with trafficking with the purpose of sexual exploitation.

Earlier this month, two teenage girls were found guilty of tampering with a crime scene and given one year probation.

But the fact anyone is standing trial for Carolina’s death is not down to the work of the authorities. Faced with police inaction, it was Amanda who single-handedly began the investigation into her daughter’s death.

Despite an autopsy indicating a violent death, Amanda was told by the police homicide squad, Dinased, that her daughter had died of “acute pancreatitis brought on by alcoholic intoxication”, according to documents seen by the Guardian. The police concluded there was no case to answer.

Carolina’s body was returned to her family, who took it home in a casket for the wake.

“I lifted the lid and my daughter had blows on her face, on her forehead, her lip was broken, her hands looked as if she’d been trying to defend herself,” Amanda sobbed. “How could she have died from natural causes?”

Amanda resolved to make her own inquiries. “I buried my daughter on the 29th. On the 30th I started to move,” she said. She began by checking Facebook videos featuring her daughter and others. She spoke to Carolina’s friends; she found out where her daughter’s suspected attackers went to school.

Through a Facebook page she set up, Justicia por Carolina, Amanda received a tipoff about where one of the accused lived. Amanda went to the building and posed as a maid looking for work. It was a ruse persuasive enough for a porter to confirm to her where his apartment was.

The same flat was raided by the police in March and the occupant was arrested.

Ecuador’s interior minister, María Paula Romo, said it was the “tenacity of the family which made this case known to us”. The minister only found out about the case through Amanda’s media interviews. She immediately assigned it to the judicial police, who reopened inquiries in December 2018. Carolina’s body was exhumed, a new autopsy was conducted and investigations began into her murder and a possible sex trafficking network. It took the police, working with Amanda, just days to prepare the case against multiple suspects.

An internal investigation into the conduct of the homicide squad has also been opened, Romo said, adding that public prosecutors and judges should also be investigated for inaction or deliberate obstruction of justice.

Two police officers have been disciplined for closing the murder inquiry, and had 8% of their monthly salary docked as a punishment.

“The mother and the family had advanced the case enormously on their own,” said Romo. “They had identified the people, they had identified the places.”

The night of 25 August 2018, Amanda hardly slept. Carolina had not returned home and Amanda’s 21-year-old daughter said her sister had logged off Facebook on her smartphone at about midnight. They lost trace of her.

At 4am Amanda rose to prepare empanadas, traditional pastries she sells on Quito’s streets. She tried to bury the sinking feeling in the pit of her stomach. Carolina had run away before, staying away for weeks at a time, and had also spent a month at a rehabilitation centre for truanting teenagers. This time, though, Amanda sensed something had happened to Carolina.

Between sobs, she recalls Carolina’s response when she told her daughter she was going to find out who she was spending so much time with. “Mami, don’t investigate, you don’t know what kind of people you’re dealing with,” Carolina had said.

“A mother must fight for her child, whether she’s dead or alive,” Amanda said. “When she was alive I was trying to save her.”

* Her name has been changed to protect her privacy.