In India and Israel there are formal affiliations with a religion that can be provided to the government (Germany and historically at least, some Scandinavian countries also require religion registration for purposes of a state administered church tax which is collected by the government and paid to your registered religious denomination.) This registration process is necessary because in both India and Israel, legal rules regarding family law and inheritance are determined based upon your official religious affiliation. There are also additional laws governing mixed religion marriages.
In the case of India, that means that if your citizenship is based upon a particular religious affiliation that when you obtain citizenship in this way, you will be subject to that religion's family law and inheritance law rules.
So the way I see it is that anyone who wants to be a citizen of India
under this criteria has to remember a few Hindu chants and visit a
temple maybe and claim that they are Hindu, irrespective of what their
actual upbringing is.
The group that is excluded in these cases is Muslims. And, the theory of the legislation is that non-Muslims are at risk of persecution generally in countries where Islamic law prevails that are predominantly Muslim.
One important feature of Islamic law is that persecution such as enslavement and death is mandated (although enforced in practice with differing degrees of vigor) for people are not "People of the Book" (i.e. Muslims, Christians or Jews) and "People of the Book" who are not Muslims are placed in a subordinate position in society and must pay a special tax associated with being non-Muslim.
Furthermore, if you were previously a Muslim and then convert to another religion, this offense is punishable by death in Islamic law, and in the countries in question, vigilante enforcement of this aspect of Islamic law is permitted and is even welcomed as a public service.
Any Muslim who applies for citizenship in India on this basis who is later discovered, either at home, or in India (which has a large Muslim minority) is at grave risk of execution by Muslims for religious reasons for the rest of their life. So, this is not something that would be attempted lightly by a Muslim in Afghanistan, Bangladesh, or Pakistan. Extrajudicial killings in Bangladesh on these grounds are not uncommon, and a Christian in Pakistan was recently released from death row based upon a false accusation of heresy (through the legal system).
Someone who wanted to prove their religious minority status would often want to show evidence of persecution to bolster their claim, as well as other indicators such as presence on church or temple rosters. The claim of an uncircumcised adult man from any of those countries that he was not a Muslim, for example, would be highly credible.
Ultimately, determining what someone's religion is is a question of fact (U.S. immigration courts make similar inquiries in asylum cases) and it comes down to what a judge will believe in light of the evidence presented. I strongly suspect that, in practice, some judges or immigration law administrators are easier to convince than others and a particular applicant faces the luck of the draw which determines their fate.
Also, since Bangladesh and Pakistan are economically similar to or even better off than India economically, the concern that someone is primarily an economic migrant rather than a legitimate asylum seeker or non-economic migrant is much less of a pervasive concern than it would be in the U.S. (although Afghanistan is still wretchedly less well off economically and less safe due to war than India, so a strong economic and non-religious based incentive to engage in fraud is present in that situation).
In theory, there could be a lot of fraud in this kind of process, but in practice, this hasn't proven to be a serious problem so far.