Yes, the phrase "in which they are enshrined" is 100% grammatically correct. This is a properly constructed
subordinate clause. Subordinate clauses (a.k.a dependent clause) are a HUGE topic on GMAT --- I would suggest consulting whatever review materials you are using.
Very briefly, if this clause were a stand-by-itself independent clause, it would be "they are enshrined in the temples."
Now, consider the ending of the last big sentence, with this piece as a separate sentence.
In ancient Thailand, much of the local artisans’ creative energy was expended on the creation of Buddha images and on construction and decoration of the temples. They [the Buddha images] are enshrined in the temples.
That's very wordy, which is why folks use subordinate clauses. The rule is:
(a) find the word that will be the anchor, the referent, in the big sentence. Here, that word is "temples."
(b) replace that word in the smaller second sentence with "which": "They were enshrined in which."
(c) Now put the "which" and anything attached to it (here, the preposition "in") at the very beginning of the clause, so it's right next to the anchor word in the original sentence:
In ancient Thailand, much of the local artisans’ creative energy was expended on the creation of Buddha images and on construction and decoration of the temples in which they were enshrined.
Does that make sense? Again, if you are unfamiliar with the the idea of a subordinate or dependent clause in a sentence, then I strongly recommend carefully reading any GMAT review materials you have on the subject.
Here's a similar GMAT SC practice question, just for more practice.
https://gmat.magoosh.com/questions/1126The question on at this link should be followed by a video explanation of the answer.
I hope that helps.
Mike