Kyrgios lost the first set of his match with Herbert and then slipped 3-0 down in the second with the crowd berating him for a supposed lack of effort.
At the change of ends, umpire Lahyani came down from his chair and spoke to Kyrgios and was heard telling the Australian: “I want to help you.”
Kyrgios denied he had benefited from Lahyani’s words saying: “He said he liked me. I’m not sure if that was encouragement.”
But Herbert fumed about the incident and said Lahyani needs to be punished for his actions.
The Frenchman said: “I know there’s something that should be done, I think. Like when I get a warning or when I get a point penalty, I get a fine.
“I think it’s both ways. It’s not like the umpires can give warnings and point penalty, then we have fines to pay.”
The US Open has since claimed in a statement that Lahyani spoke to Kyrgios because he was concerned he might need medical attention.
But Federer believes Lahyani’s actions were inappropriate.
Federer said: “It’s not the umpire’s role to go down from the chair. But I get what he was trying to do. He behaves the way he behaves.
“You as an umpire take a decision on the chair, do you like it or don’t you like it. But you don’t go and speak like that, in my opinion.
“I don’t know what he said. I don’t care what he said. It was not just about How are you feeling? Oh, I’m not feeling so well. Go back up to the chair.
“He was there for too long. It’s a conversation. Conversations can change your mindset. It can be a physio, a doctor, an umpire for that matter.
“That’s why it won’t happen again. I think everybody knows that.”