I could see this... something akin to how religion spreads now. Make it a spectrum as opposed to just having religion spread as it does now.
1) Very little random chance
I wonder about this. I like it, but then how does that work with how religion also spreads? Perhaps we need a formula. At a certain point (not a point in time, but based on certain conditions) a religion spreads or fades. I like the idea of figuring out these factors. History can be a guide here, I think.
2) Not being the state religion
In some places in history this played a factor, as in how Buddhism died out in India. Other factors for that were a) some persecution (by Islam), b) losing state sponsorship (economic base), c) losing its social place (Islamic merchants basically took their place), d) its ideas becoming absorbed into Hinduism, and perhaps it becoming obsolete? b and c, and potentially a point to a top-down effect. But, in China, not ever having been a state religion there, Buddhism was always quite popular. The thing I see more important than something being a state religion, is actually whether or not it had state economic support: here building temples and monasteries were important, as well as the state plundering monasteries. While there were two direct persecutions of Buddhism in China (for economic reasons, monasteries were fabulous rich and the state was in debt), Buddhism bounced right back afterwards. One probably reason for the popularity of Islam is its state support (but, unlike say Buddhism, Islam explicitly conceives of itself as having political and social aspects to it).
3) Atheist or Secular civics rise the chance
Absolutely. Although, Mark Juergensmeyer has argued that the rise of religion and fundamentalism is actually a response to secularism. He argues in his
Terror in the Mind of God that most terrorism is against the secular state and many of his interviews with fundamentalists show that they respect other religions, but deride secularism. On the other hand, there was a decline of traditional religion in the industrialized world because of secularism in the mid-50s to late 80s. So, maybe for vanilla ROM a decrease in religion with secularism or atheism, and for ROM revolutions those civics potentially leading to religious instability?
4) State Church civic rise the chance of not-state religions fade away
Sure. See my comments on #2 above. I think Marxist analysis does explain a lot by focusing on the economic basis of change.
5) Some techs rise the chance
Like what? Scientific Method or something? Or military techs for Jainism? Or how about the increase of Buddhism and Hinduism in North America with late capitalism. They are money makers. The exact same is happening in Korea with Christianity. The increasing popularity in those new religions (in NA and Korea) is due to them being seen as new, rational, dynamic religions as opposed to the corrupt, superstitious, and static old religion.
Direct persecution is effective to a certain degree, but sometimes not. Aside from the actual inquisition, which I know little about, The Cultural Revolution is a perfect example. 700,000 monks killed, most forcibly defrocked. Institutional Daoism, which was on its last legs in the 19th century, was wiped out. And yet, Buddhism has bounced back in China even more than Confucianism and Daoism. Of course, this is also due to economic and PR reasons. Buddhist heritage sites make money. Perhaps this it due to the global popularity of Buddhism.
7) Buildings decrease the chance of its religion fading away and increases of others religions.
8) Holy Shrines has twice this effect.
In terms of modelling history, I actually think this may be the biggest factor. It could model state support, even if the religion isn't a state religion. Where non-State religions flourish was where there was still state support.
I would add:
9) Global spread of the religion decreases fade chance, localization increases fade chance
10) whether one has taken one of the civics like fundamentalism or state church or something, should decrease the chance of the state religion fading later.
11) how many other civs have the religion as a state religion could play a factor, increasing spread with more, increasing the fade if none.
12) I don't think we really know exactly why some religion or ideology becomes more popular. We have ideas. I think there should be some randomness to this all. Think of a slider with fading on one end and spreading on another. I think every 10 turns this slider could move left, right, or stay the same randomly for each religion. Sometimes, no matter what you do, a religion spreads. Sometimes, however much you want to keep a religion, it fades (ala North America and Korea example above). It makes sense that this would also get more volatile in the modern period, where the rate of social change increases.
13) How long a religion has been in a city should have an effect. Those places where Buddhism and Islam were the first religions in a place are for the most part still Buddhist and Muslim.
14) The number of religions in a city should increase the chance of it fading. The more religions there are, the more chance that syncretism happens and one gets absorbed into another (like Buddhism in India). Or perhaps, thinking of it like there are only so many people for so many beliefs. If this latter part is true then:
15) A higher city population should decrease the chance of a religion fading.
So, a final note, I think there should be considerations both civic-wide and city specific for the fading/spreading of religion.