I noticed that around turn 160 the last religion was gone to someone else, they had tradition 1 and piety 5.
Game was on continents, immortal, i didn't finished it as i was trying to wage war early and it didn't worked well.
I was playing Spain and manage to get 3 rd religion, Ethiopia and Celts were also there.
I thought Poland have Been beaten by someone else to the last religion.
What i am sure of is that the AI go up the piety tree even if they havn't got their religion yet.