In Catholicism, baptismal records exist in the church and there are rites of passage like confirmation.
It's more complicated in the Jewish religion. In a mixed marriage, if the mother is Jewish, the children are considered Jewish, as it's a matriarchy. There are other more complex factors too, but that's the obvious one I'm aware of.
I would imagine other religions like Lutheran and Protestant, work the same way as in Catholicism It would depend on baptismal records registered in the church, how the children are brought up.
To me religious affiliation means belonging to a specific church and means something different from faith, in that you can be a Catholic by birth, but no longer practice or believe but it doesn't take away from your ancestry.
But it's worth researching the subject for anyone who is interested in the details.