For Christians and some other religious people, memory cannot be in the brain - or more precisely, not primarily so.
The brain dies and rots along with the rest of the body; but the self endures until after death; indeed for Christians the self is restored in eternal union with its now-perfected body (i.e. resurrected).
Memory cannot therefore be lost at death. At least, important memories - those essential to the eternal self - are not lost at death.
Therefore memory must be elsewhere than the brain - or, at least backed-up elsewhere.
Indeed, it would be truer to say that those memories 'in our brain' are at most merely an incomplete and fragile back-up for the real, enduring memories which are elsewhere.
It could be, it is perhaps even likely, that memories are stored elsewhere and the brain only accesses them. And therefore that the memory losses of ageing, trauma and disease are therefore primarily a loss of access to memories, rather than a destruction of memories.
Where might memories therefore be?
One constraining fact may be that our memories are our memories, that is our private memories - that is, they are not (or not typically) accessible to others.
This suggests that memories are stored in some part of us, some extension of our-selves, some place not in our mortal bodies - presumably in that which survives death, variously called the soul or spirit.
Since the soul is not detectable, then neither are our memories. e can, it seems, only detect the machinery which gives our mortal bodies temporary access to these permanent soul-stored memories.
When we 'forget, or when memories are 'destroyed' by age, trauma, disease then this is because the method for access has been damaged.
This is significant, even tragic, from the perspective of mortal life; however, in terms of our life in eternity we need not be so worried, need not despair: memories are indelible, permanent, as eternal as we are.
This also highlights the real problem about memory - which is not the forgetting of good things but the never-forgetting of bad things; and when the reality of what this means has sunk-in; then this fact points us at the necessity for the atonement of Jesus Christ in the time-frame of eternity.