My reason for saying that you can maintain ego when dead is based on studying after death communications (and experiencing one such very convincing one myself). The ADCs are definitely coming from distinct entities with distinct personalities, intent, etc. Hence, ego is maintained. There is a huge body of literature on ADCs.
Supposedly ego is refined through experience on this or the metaphysical level of our reality until it has attained a harmony with deeper truths. That is unless you consider the ego to be the persona we create while we are incarnate in the physical body - in which case it ceases to be relevant when being in the physical body ceases to be relevant. But a sense of self remains - with a different sense of context.