Gaja Anandan and his father Bhoopalan were part of a larger group of 10 persons who had come to the temple to offer worship.
Police said all of them had entered the temple after clearing security. However, Gaja Anandhan and his father came out in advance and their relatives stayed back to worship at the Anjaneyar (Hanuman) temple at the entrance of the main shrine.
A heated argument followed and Boopalan punched the constable. The policeman's colleagues then surrounded the two and thrashed them and they suffered some bruises, police said.
The two Malaysian tamils were then detained. The constables who beat them had also had been asked to be present for an enquiry tomorrow by higher officials, they said.