In a properly conducted secret election, it is of course impossible to find out how each individual person voted.
But each polling station reports their (anonymized) results to the election committee, so it is known how the people who went to the same polling place voted in general. This allows to measure the regional political support of specific parties with some granularity. A politician might use that information to make decisions, like where to build a school and where to build a garbage dump.
Pre-election polls and exit polls can be used to determine the political sentiments of specific demographic groups. They usually don't just ask how a person voted, but also some demographic information about them like ethnicity, age, education level, income group etc.. While people are not obligated to answer such polls truthfully or at all, they usually show clear patterns regarding which demographics tend to vote which politicians. This helps politicians to see which demographics (generally speaking) support them and which (generally speaking) oppose them.
That means if exit polls showed that very few Pastafari faithful under the age of 30 in District 1 voted the A-Party, and you are a 26 year old Pastafari from District 1, then politicians from the A-Party will likely assume that you did not vote for them. They might be wrong about that. But it is reasonable to assume that you didn't.
Also, can she prioritize the government's funds only for those who vote for her in case she wins the elections?
Openly discriminating people based on religion ("no social welfare for Pastafaris!") might be challenged on constitutional grounds. But there is a lot a politician can do to covertly discriminate against specific demographics in ways which provide plausible deniability.
In a country like India, one possible way to discriminate is agricultural policy. The two main religious groups in India, Hindus and Muslims, have different eating habits. Hindus don't eat cows while Muslims don't eat pigs. So subsidizing or regulating one kind of ranching but not the other is one possible way to discriminate or favor one religious group while being able to claim that it is a purely economic or ecologic decision. And this is just an obvious example. There are many other areas where economic interests correlate with ethnicity.