In April 2015, bystanders trying to keep the peace stood in front of Baltimore riot police during demonstrations in the wake of the death of Freddie Gray. (Jabin Botsford/The Washington Post)

The Justice Department is pushing in the waning days of the Obama administration to cement major police reform agreements in Baltimore and Chicago, mindful that President-elect Donald Trump and his chosen attorney general are far less likely to impose change on local law enforcement when they take over.

Ending discriminatory and heavy-handed police practices has been a hallmark of the Justice Department under Attorney General Loretta E. Lynch, and the “pattern-or-practice” investigations of the Baltimore and Chicago police departments are cornerstones of her legacy.

But with less than two months before Lynch will leave office — giving way to a president who has endorsed tougher policing and an attorney general nominee who is wary of consent decrees that bind departments to changes — time is running out for her to secure legal agreements to guarantee reforms.

On Thursday, Lynch took the unusual step of announcing that she would travel to Baltimore next month in hopes of making an announcement — even though negotiations with the city are ongoing.

“At this point, the ball’s in the city’s court, but we are looking forward to getting a positive response from them on finalizing this consent decree,” Lynch said at a Politico Playbook breakfast.

She added later: “Having that court enforceability is key, and it’s vital.”

The public statements are undeniably a bid to put pressure on Baltimore to sign a consent decree and to do it soon. The Justice Department released a report in August alleging that Baltimore police had engaged in years of racially discriminatory policing and used excessive force, and city leaders at the time said they would work with federal officials to make ­changes. But their self-imposed Nov. 1 deadline to hash out a court-enforceable agreement came and went, and the city now has a new mayor.

Former Justice Department officials and civil rights activists say that for there to be true change in Chicago and Baltimore, it is essential that officials in those cities at least agree to a reform framework by Trump’s inauguration on Jan. 20. In Baltimore, there exists an agreement in principle; in Chicago, there does not.

“In a tight time crunch, you try to get a city to agree to a statement of principles which says, ‘We’ll have a consent decree with a monitor and the agreement will cover these topics,’ ” said Jonathan Smith, formerly the chief of special litigation for the Justice Department’s Civil Rights Division. “So, in Chicago, that means the community has to insist on a speedy agreement, and they’ve got to put pressure on Mayor [Rahm] Emanuel.”

If the agreements are not in place before the start of Trump’s presidency, Smith said, it seems unlikely that wide-scale reform spurred by the Justice Department will be enacted.

“Anytime there is a transition of power, things slow down,” Smith said. “But it’s really going to slow down with someone like [Attorney General nominee] Jeff Sessions coming in. Even if they move forward on these things, which seems frighteningly unlikely, it’s going to be moving very slowly.”

Lynch was sworn in on the same day as the funeral for Freddie Gray, whose death from injuries suffered in police custody sparked riots in Baltimore in April 2015, and her first trip as attorney general was to visit the city to meet with police and residents. People familiar with the negotiations there said the Justice Department has been sending over the agreement part by part in hopes of speeding the process along.

Anthony McCarthy, a spokesman for the mayor’s office, said Thursday that “everyone is moving ahead with the idea of completing a consent decree” but he said he could not guarantee it would be completed by Jan. 20, nor did he know what would happen with a new presidential administration. He said Mayor Catherine Pugh was briefed Wednesday and “wants to make sure that any consent decree is in the best interests of the people of Baltimore.”

“Fast is not the optimum priority,” he said. “There are a lot of complex issues, and you know that we have been doing this for about 3½ months, where other cities took years.”

In Chicago, the likelihood of reaching a consent decree before Jan. 20 is even less than it is in Baltimore, although the Justice Department could announce its findings before Trump is sworn in next month, according to an official familiar with the investigation, who spoke on the condition of anonymity to discuss an ongoing investigation.

While not definite, the official said that they were “optimistic” and that “it’s possible it could be before Inauguration Day.”

“We’ve moved in toward the final phases,” the official said.

Adam Collins, a spokesman for Chicago Mayor Emanuel (D), said he couldn’t speak for the Justice Department regarding the timing of the ongoing probe. Collins said in a statement Thursday that the city “will continue to be fully committed to comprehensive public safety reform, just as we have been.”

In some cases, the negotiations over consent decrees have given way to acrimony. Such was the case in Ferguson, Mo., where the City Council voted to reject the agreement negotiated between the city and the federal government, prompting the Justice Department to file a lawsuit. The council then approved a set of reforms the next month, and the Justice Department’s lawsuit was resolved not long after.

Dean C. Angelo Sr., president of the Chicago Fraternal Order of Police, said he thinks that officials involved in the probe are “typing their backsides off . . . trying to get through the Chicago report before the inauguration.”

The police union official said he would be “very surprised” if the report is not finished before Trump takes office, but he hopes authorities are not rushing to get it done in that time frame, noting how long some other investigations have taken.

“This is the largest municipal police agency they’ve ever been tasked to investigate,” Angelo said in a telephone interview Thursday. “If you look at six months for Ferguson, it should be a year and six months, or more, for Chicago.”

It is hard to predict what the Justice Department might do under Trump, who has positioned himself as a law-and-order candidate wary of restrictions on police. Trump said police in Chicago could stop a spate of deadly violence by being “very much tougher than they are right now,” and he wrote to the International Association of Chiefs of Police that he would generally keep the federal government out of local law enforcement’s business.

Sessions, a Republican senator from Alabama, has also in public statements taken a somewhat circumspect view of consent decrees.

“The decrees can be good and healthy,” he said at a 2005 Senate hearing on the subject. “But as the Supreme Court is telling us, we ought to be respectful and understanding that it does impact in a significant way our separation of powers, the entire nature of our democracy, because it is removing the power from the people and putting it into the hands of an unelected judge who is not accountable.”

A transition official declined to comment.

It is possible, too, that the Justice Department without Lynch at the helm would simply continue its work. On Thursday, the department announced that it had opened a new pattern-or-practice investigation into the district attorney’s office and sheriff’s department in Orange County, Calif. That investigation stems from allegations that they both systemically used jailhouse informers to get incriminating statements from inmates who had lawyers, violating the Sixth Amendment.

And a separate Justice Department office working on police reform — the Office of Community Oriented Policing Services — announced it would conduct a comprehensive assessment of the St. Anthony police department in Minnesota. That office generally relies on the cooperation of local officials, rather than the court system, to implement the reforms it recommends. A St. Anthony police officer was recently charged in the shooting death of Philando Castile during a traffic stop in a Twin Cities suburb over the summer. The aftermath of that shooting was broadcast live by Castile’s girlfriend on Facebook and quickly captured national attention.