Was ancient India a theocracy?

No, it was a ‘Dharmacracy’. Kings were not above the law; they were servants of Dharma (Natural Law). Their duty was to protect freedom, not enforce a single creed.