The Malaysian, ranked over 35 rungs above the sixth seeded Indian, pocketed the contest 14-12, 11-6, 6-11, 9-11, 11-9.
In March earlier this year, Mahesh had beaten Ivan in a five-game thriller in the Wimbledon Club Open in England in a match that lasted 107 minutes.
The essence of the contest was similar this time but a few crucial points eluded the Indian and Ivan ran away with the match.
In the first round, Mahesh had defeated qualifier Chris Van der Salm of New Zealand 11-7 11-2 11-6.