Osaka, whose second straight Grand Slam title at the Australian Open in January propelled her to the top of the rankings, avenged a loss to Mladenovic in Dubai last month in her first match since she lifted the trophy in Melbourne.
World No.4 Federer was dominant in the opening set but was pushed in the second before he wrapped up the 6-1 7-5 in one hour and 17 minutes.
Osaka will next face Australian Open semi-finalist Danielle Collins, who thrashed Kirsten Flipkens.
A break to begin the second set put her in complete control before another gritty hold for 4-2, although there would be a brief stumble.
In the press conference after her first win at the Indian Wells 2019, Osaka spoke about the inconveniences which are caused to her while playing night matches. We started, I think, pretty nervous, both. "We always play three-setters, and suddenly, we have been there again and playing until the end, and in the end of the match, she definitely played better than me", she said of Williams. "I was just here to have fun, maybe get to the quarters", AFP quoted her as saying.
"Don't remind me of the stats", Wawrinka quipped after gutting out a 6-4, 6-7 (5/7), 7-5 second-round victory over Marton Fucsovics.More news: Governor Kay Ivey, Attorney General Steve Marshall tour devastation in Lee County
There was disappointment, too, for 2011 victor Caroline Wozaniacki, who fell 7-5, 2-6, 7-5 to 59th-ranked Russian Ekaterina Alexandrova.
The 38-year-old veteran American broke the Czech once more in the match's final game, letting loose with a euphoric scream as she sealed one of her most impressive victories in recent memory. "I did go through doubtful moments and questioning everything and experiencing a surgery for the first time in my life was something that I've never experienced before".
Kyrgios shrugged off those comments and said Saturday he'd put the good and bad of Acapulco behind him. "Novak said he is pain-free and I knew he would return to his best, although it did surprise me how quickly he managed to do that".
However, the American was unable to close it out, a double fault and a pair of errors handing Djokovic the opening set.
Former world number one Angelique Kerber was almost flawless en route to a 6-0 6-2 dismantling of Yulia Putintseva, winning 93 percent of her first service points under sunny skies.
"I injured my tendon, then when I came back to play in Paris Bercy, I had an abdominal injury, [and then] I injured my foot a little".
Pliskova next faces another qualifier, Belgian Ysaline Bonaventure, who defeated 28th-seeded Donna Vekic of Croatia 1-6, 7-6 (7/5), 6-4.