Roger Zelazny's Lord of Light is a weird hybrid, something he's listed as one of his "experimental" books. It seems initially we're in a low-tech world where the Hindu religion rules. But you'll find out (this is kind of a spoiler, but we're only about 20% into the book when we learn this) that the gods are very real - and in fact they're the first human settlers of this planet. They use technology to rule as gods while keeping the technology level low - and if you do what you're told, you'll get a new body when you get old (through a technological process dressed up as religion). One of the first settlers who calls himself Sam (short for "Mahasamatman," although he has many other names as well), walks among the main populace and preaches the word of the Buddha. He's set himself against the other "gods," being in favour of letting the people use all the tech that's available.
Some of the writing is either drawn from books like the Vedas or at least made to look like it. Some of the interactions between gods are written in an incredibly stilted way. I found the book quite entertaining for how it twisted religious teachings of three different religions and forced you to think about them - and about the differences between religion, magic, and technology. But it's a slow read with some structural problems - I suspect it may put some people off.