She has what one children’s advocate called “the worst job in state government.” She runs an agency that in recent months completely lost track of a 5-year-old Fitchburg boy, allegedly ignored multiple reports of sexual abuse of another child, and was chastised by a federal judge for failing thousands of children whose futures in Massachusetts he called “murkier than in most places in America.”

The agency, which is charged with protecting 36,000 children from abuse and neglect in some of the most troubled families in the state, is woefully underfunded, its caseworkers are overburdened, and morale is low, according to advocates.

Competence is also a chronic concern, according to federal judge William G. Young, who declared in November that the department has “failed not only to comport with national standards of care and state and federal requirements, but also to comply with its own internal policies” for protecting children in foster care.

Young issued his ruling as he dismissed a class-action lawsuit against the department, but said he was disturbed to find that DCF places children in inappropriate foster homes, lacks proper educational and medical services, and has subpar caseload management and training practices.

The agency’s failings, Young said, were “more about budgetary shortfalls than management myopia” and added: “We are all complicit in this financial failure.”

“When next you bemoan your tax burden, remember that, at that moment, somewhere in Massachusetts there is a youngster who has just been taken from her parents’ home,” Young wrote. “She is confused, inexpressibly lonely, homesick, and desperately afraid. Because of Massachusetts’ penury, her future is murkier than in most places in America. Do you care?”

Roche’s response to that ruling, as well at to the case of the missing boy, Jeremiah Oliver, has been relentlessly forward-looking.

“My passion has been how to help the family unit, to maintain safety around the kids, so children can thrive,” said Roche, a mother of two. “I’m not asking anything different than my children had. I want the children of DCF — who I call my children of DCF — to have the same opportunity.”

A social worker who has spent 33 years climbing the ranks of the state’s social services system, she became interim commissioner in April and was given the job permanently in October.

Born in the Bronx and raised in Puerto Rico, she is one of four children of a teenage mother. She says she was raised in part by her grandmother and great-grandmother, like many of the children in foster care the agency now tracks.

Roche, 59, spent six years working for the state Department of Youth Services before joining the social services department in 1987. Since then, she has risen from area director to regional director, to deputy commissioner in 2007.

As DCF commissioner, she has “the worst job in state government,” said Maria Mossaides, executive director of Cambridge Family and Children’s Service, a private child welfare agency. “And that is because you are dealing with an inconsistent mandate, a mandate that says protect children and preserve families, and that is a very hard line.”

The agency — and Roche — were cast into an unwelcome spotlight in December when officials acknowledged that Jeremiah Oliver, who had been under DCF supervision since 2011, had not been seen by a relative since September and by a DCF worker since May.

Authorities have said they are treating the boy’s disappearance as a potential homicide. Albert L. Sierra, 22, the boyfriend of Jeremiah’s mother, has been charged with brutally beating the boy, and his mother, Elsa Oliver, 28, has been charged with doing nothing to stop the abuse.

Roche has fired a social worker and two managers who handled Jeremiah’s case. Shortly after that, the superintendent of schools in Northborough went public with her concerns about the agency. She said DCF only removed a second-grader from home after school officials filed 13 reports of sexual abuse in one year.

No one has called for Roche’s ouster, and Governor Deval Patrick has expressed support for her.

But with Jeremiah still missing, the agency is under intense scrutiny. The state auditor, the state Office of the Child Advocate, and three legislative committees have launched investigations. The Children’s Welfare League of America is conducting an outside review.

Some child advocates worry the focus on safety, while long overdue, could have a downside. More children under DCF supervision, they say, could now be removed from their homes, because DCF workers would rather take the safer route of sending children to foster care, rather than leave them in a home that could result in another tragedy.

The advocates say that approach reflects workers more concerned with job safety than helping families in distress.

“Safety concerns tend to blind people to the connections that kids have to their families and communities,” said Michael Dsida, a public defender who represents children and families battling DCF custody orders.

Martha Grace, a retired chief justice of the Juvenile Court, said she often saw a flood of children being sent into DCF custody after the agency was hit with past scandals.

“All of a sudden, we would see this flurry of filings in the court, and you’d look at them and say, ‘Whoa. This wouldn’t have been filed two months ago,’ ” Grace said. Some of the orders were warranted, Grace said. But she added: “You can’t let the horror of this particular situation drive bad decisions.”

In the past, commissioners at the agency, which was known as the Department of Social Services prior to 2008, have been forced to resign after children died on their watch. Roche could face such calls in the coming days.

But Marylou Sudders, a former president of the Massachusetts Society for the Prevention of Cruelty to Children, said Roche is well positioned to steer the agency through turmoil.

“What I’m struck with is someone who is dedicated to public service and is committed to child protection,” said Sudders, who has known Roche since the 1990s, when Sudders was the state’s mental health commissioner. “Her deep knowledge of the department will be helpful and will serve her well in this time of crisis.”

The union that represents DCF social workers took a vote of no confidence in the previous commissioner, but has not taken that action against Roche. Peter MacKinnon, DCF chapter president of SEIU Local 509, said Roche sincerely believes in trying to protect children from harm, but has been slow to lessen the burden of heavy caseloads.

“We found her slow to act when it counts and, especially now, when you’re in a crisis mode, you need someone who is going to be there when it counts,” MacKinnon said.

Those who have watched the agency closely for years say the ability to fix it will not depend on whether Roche is ultimately deemed the right person to lead DCF out of scandal. Grace, the former juvenile court judge, said it will require attention even after the latest wave of public outrage has faded.