The triumph is only a consolation for the tourists as Australia dominated the series, winning it 4-1 on home turf.
David Warner top scored for the Aussies in the final clash with an impressive knock of 122 runs, including nine fours and three sixes, off 113 balls.
The 24-year-old also reached a century, ending the innings unbeaten on 102 off 84 balls, as Australia posted a total of 330-7 after 50 overs.
Hastings claimed the wicket of Sharma later in the innings, with the batsman just one run shy of a century as he was caught behind after facing 108 deliveries.
India required 13 runs in the final over, and they were dealt a blow when MS Dhoni went for 34 off 42 balls off the bowling of Marsh.
The tourists needed six runs from their last four balls and in the process Manish Pandey reached his hundred - hitting 102 runs off 80 balls.
Pandey (104 not out) and Gurkeerat Singh managed to get India over the line to claim their only victory in the five-match series.