The tourists started their innings needing an unlikely 407 to seal victory in Sydney, while Australia's declaration on Sunday meant the home side had a day and a session to snare 10 wickets.
Rishabh Pant helped steady the ship and put India on the front foot, but holed out to Pat Cummins off Lyon's bowling for 97, while Cheteshwar Pujara scored a neat 77 before being bowled by Josh Hazlewood.
At this point, India were still 135 runs short and looked to dig in for the draw.
Vihari faced 124 balls before he found his first boundary and grabbed another four three balls later, and finished on 23 not out, while Ashwin made an unbeaten 39.
The fourth Test starts in Brisbane on Friday.