How could it happen that people would identify more as Bengali, Punjabi or whatever than as Moslem, Hindu or Sikh?
Could an Indian federation have still happened on Independence
One thing to consider is the amount of conflict between groups.
Identity and groups are formed by two things - similarity to those within the group and difference to those outside the group.
When religion is important because of conflict and discrimination, it seems to trump any similarities. Look at Northern Ireland. It's a small place, there aren't many people, they have a clearly defined accent and slang. These are all things that should cement a common identity but don't - religion trumps it all.
You can contrast that with the identities of people in England and Wales. There is nowhere near the same level of discord between protestants and catholics, and people use other things more to create their identity. I feel certain that a protestant and a catholic from Hastings would feel more connected with each other than in religious terms with a protestant and a catholic from Newcastle. If you took those four people and stuck them in a room, I reckon they would be more likely to pair up on regional grounds more than religious ones.
So, translate that effect to India - how would people identify more by their region and local language? For a start, we'd need to find a way of removing tension between the faiths. How would a Punjabi muslim or dalit have more in common with a Punjabi jat than with their Bihari equivalents (apart from by joining a SUV owners club)?
We'd need to create a great deal more harmony between religions and castes. We'd probably need more conflict between the regions as well. So an Akbar-style ruler of one particular area who insisted on religious tolerance for a long period, but who also fought wars against neighbours who spoke a different language would probably do the trick.
So I'd say it's almost impossible post-independence, and difficult after Shah Jahan took the throne, more so once Aurangzeb succeeded him.