"It is because of the kindness and grace of lord Giriraj and Thakur ji that I won," Ms Agarwal said.
The BJP and the Congress both had polled exactly 874 votes in ward number 56 of the holy town.
After some discussion, the candidates, their parties and poll officials decided that the tie would be settled with a draw of lots.
The names of both were put on chits and placed in a box from which the District Magistrate picked one.
Luck favoured the BJP candidate.
It was an unusual way of deciding the winner but this is not the first time, say officials.
A lucky draw also decided the winner when two candidates polled equal votes during district elections in Meghalaya in 2014.
Drones fitted with cameras were used for the first time during the November 26 voting in Mathura to help monitor the election and check crime.
Eight months after its landslide victory in UP assembly elections, the BJP is set for a big win in the local body polls in India's most populous state. In 2012, the BJP had a mayor in 12 municipal corporations.rporations.