Christine Blasey Ford testified before the US Senate Judiciary Committee that Mr Kavanaugh pinned her to a bed, tried to remove her clothes and put his hand over her mouth in the early 1980s.
The FBI is investigating Ms Ford's and three other women's claims against Mr Kavanaugh, in a probe authorised by the president.
Yet imitating Ms Ford at a rally in Southaven, Mississippi on Tuesday night, Mr Trump said: "How did you get home? 'I don't remember.'"
He added: "How did you get there? 'I don't remember.' Where is the place? 'I don't remember.' How many years ago was it? 'I don't know. I don't know. I don't know."'
Mimicking her, he said: "But I had one beer - that's the only thing I remember."
It marked the sharpest criticism by Mr Trump of Ms Ford since she came forward publicly with the allegation last month.
He had previously called her a "very credible witness".
Ms Ford's lawyer, Michael Bromwich, called Mr Trump's attack "vicious, vile and soulless".
"Is it any wonder that she was terrified to come forward, and that other sexual assault survivors are as well?" Mr Bromwich tweeted.
"She is a remarkable profile in courage. He is a profile in cowardice."
The president was in Mississippi on Tuesday looking to use his influence to sway the outcome of a low-profile election that could tip the balance of the Senate.
All signs suggest Democratic women are energised by opposition to Mr Trump's presidency and the primary season yielded record numbers of female candidates.
The message from Mr Trump and his allies looks to channel the frustration and anxieties of the party's core voters - white men - just weeks before an election.
The president said: "It's a very scary time for young men in America when you can be guilty of something that you may not be guilty of. You can be somebody that was perfect your entire life and somebody could accuse you of something ... and you're automatically guilty."
Mr Trump also pretended to be a son asking his mother how to respond to an accusation.
Mr Kavanaugh's confirmation battle and the national soul-searching over sexual consent it has provoked threaten only to further motivate liberal female voters, leaving Republicans searching for a counterweight.
In his warning, Mr Trump echoed some of his allies.
Steve King, a Republican member of the US House of Representatives from Iowa, said: "If Kavanaugh is not confirmed, every man is subject to seeing their life's work and their reputation destroyed by an unsubstantiated allegation."
Republican Senator John Kennedy of Louisiana declared: "This is no country for creepy old men. Or young men. Or middle-aged men. But this is no country at all."
And Mr Trump's oldest son, Donald Trump Jr, told the Daily Mail this week: "I've got boys, and I've got girls. And when I see what's going on right now, it's scary," adding that at the moment he fears more for his sons.
The rising frustration came as Mr Kavanaugh's confirmation process played out before the country, with him and Ms Ford appearing before the Senate Judiciary Committee last week to discuss her accusation.
His confirmation continues to hang in the balance as the FBI investigates the allegation, which Mr Kavanaugh has forcefully denied.
With the midterm elections just weeks away, Republicans risk losing the House and possibly the Senate as they face an energised Democratic party - particularly educated, suburban women and minorities.
They also have to confront a wave of Republican retirements, as well as the president's sagging approval ratings and the tide of controversy around his White House.
Polls show Republicans are more likely to be sceptical of the #MeToo movement, which has spurred women to come forward with their stories of sexual assault and harassment, and to believe it has gone too far.
Republicans argue the Kavanaugh debate will drive enthusiasm among men and women.
Additional reporting by agencies
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies