The Wimbledon finalist, who also triumphed at the Citi Open last week, edged Medvedev 6-7 (2-7) 6-4 6-2 in an energy-sapping contest played in intense heat and humidity.
Kyrgios lost the opening set in a tie-break but bounced back superbly from there, claiming a decisive break in the second set courtesy of a searing backhand pass before wrapping up the match with another break of serve in the third.
The win was Kyrgios' 14th in the last 15 matches, and was his third over Medvedev in four meetings.
The Australian's mother, Norlaila, is currently battling an illness in hospital, and Kyrgios wrote 'Be strong Ma' on a TV camera after the win.
"It's hard because even travelling now, my mum is in hospital at the moment, my dad hasn't been very well, my brother just had a baby and I don't get to be there with my family when normal people would like to be with them," Kyrgios said.
"It's hard being from Australia because we can't travel back and forth. There's a lot of things people don't see. They only see me winning, losing, throwing a racquet, doing those things. They don't really understand the challenges that I face or what people on tour face, what's going on in their personal lives."
On his victory against Medvedev, he said: "I've had some success against him in the past and he's beaten me before so I feel like we know each others' games well.
"I'm not the type of player who goes into these matches looking at rankings or anything like that.
"It's just who I'm playing and what kind of ball they're giving me and today I had a very clean objective of how I was going to play - a lot of serve and volley, a lot of aggressive play from the back - and I executed better than he did on the day.
"That's all it came down to. He won the first set and I feel like I had opportunities there as well so hopefully I can keep this rolling."
Kyrgios' red-hot form has made him one of the pre-tournament favourites for the upcoming US Open but he's trying not to get carried away despite his victory over World No 1 Medvedev.
"Look, a grand slam is much, much different to any other tournament," he said.
"If I was in this position of a grand slam, you've still got to win another set and that's not easy at all. He's a machine.
"He's the best player in the world for a reason and at a grand slam he's a totally different beast."
Kyrgios moves on to face fellow Australian Alex de Minaur next for a spot in the Montreal quarter-finals.
"Look, I feel confident in my body and my mentality going in to the US Open but at the same time there's so much time between then and now," he added.
"I've got to focus on this event and then Cincinnati. There's so many things I've got to look forward to. I'm not even going to think about the US Open right now.
"I need to take care of my body."