Lochte cruised into Monday night's final when he won his heat in four minutes 10.66 seconds, more than four seconds faster than Phelps.
Phelps won his heat in 4:14.72 to qualify second fastest for the eight-man final. Only the top two from the final will qualify to swim the event at the London Olympics.
Both men were untroubled while booking their places in the final, swimming well outside their best times as they tried to conserve their energy for the first of a series of head-to-head clashes over the next week.
"It felt fine," said Phelps, who won the 400 medley at each of the past two Olympics and holds the world record at 4:03.84.
"It think it was a second slower that what I did at the trials four years ago."
Lochte, who won the event at each of the last two world championships when Phelps opted not to contest the gruelling race, said he was impressed by his rival's performance and expecting a tough final.
"I think that was the easiest 4:14 he's ever swum. He looked really, really smooth," Lochte said.
"I held back in the first half of my race...so I know I have a lot left and I can swim a lot faster tonight.
"I know I will have to swim faster because it's going to be a dog fight."
Dana Vollmer topped the qualifiers for the women's 100m butterfly when she won her heat in 56.59, just half a second outside Sarah Sjoestroem's world record.
- Related links