Just to illuminate because i havent seen this discussed but the two factors related to whether an ai will pursue cultural victory are traits and # of holy cities. Credit to Aethylwind in twitch chat for explaining it right here:
"In particular, the AI progresses to the next "culture victory stage" 1 era later if the X/Y values of its capital city add up to an odd number than if they add up to an even number.
It has to value culture at 10 in order to pursue cultural victory, it starts at -3 because of Aggressive AI, gets 4 points for any of the traits Spiritual, Creative, Philosophical, Financial, and Industrious, 1 point for every holy city, and a random value from 0-6 depending on the location of its capital city. There's also another -3 I can't identify related to the AI's favorite civic - my best guess is Theocracy penalizes them another -3 (It's coded as isNoNonStateReligionSpread, which would suggest Theocracy).
So with only one Culture-valuing traits, you'd always need at least 3 holy cities to pursue cultural victory (-3+4+3+6 = 10). You'd have a lot better "chance" with another 2-3 though."
So basically, if a leader owns two of any of the above traits and has the early game commerce to pursue founding religions, there's a high chance for them to turn on the culture slider down the road. This is why we see Gandhi, Hatshepsut, Willem, Huayna Capac, Louis, and the like pursue cultural victory so vehemently, because they are double culture traiters who tend to found religions and turn on the slider while we see leaders like Pacal go space more often because they only have 1 culture trait and often can't found the requisite number of holy cities to make up the difference. This also has the hilarious knockoff effect where we've seen leaders like gilgamesh and kublai khan get huge and inexplicably turn on the culture slider 5% off domination because they are 1 culture traiters and have conquered the number of holy cities to trigger going into the first stage of cultural victory.
As a result, If you have rammy to win, culture is a good call. Hammurabi despite having a culture research flavor and having a love for wonders will almost never go cultural victory because he has no culture traits , and under aggressive ai, needs 7 holy cities for even the very low low chance of considering culture. He'll almost always go space as a result.