I read this short story as a child, in 2005 or earlier. I do not remember much of it. I do not know when it was published or written. I don't believe it was particularly aimed for children - in fact, the book had scholarly footnotes explaining the story.
I remember two details of the story quite vividly: The story concerns a land where one's wealth determines one's self worth. The richest people are believed to be gods, while the poorest people have a status of animals. There was regular sacrifice of the poorest people to the richest as part of serving them as gods. There is also I believe lots of theft and murder, as people are desperate to have money (I may be misremembering that exact detail). The people end up on a star or a planet made of gold at some point in the story.
The second detail is that there is a sword that can win any war via swooshing it. It has the ability to instantly vaporize one's enemies.
There's also a king and a queen and other fantasy tropes.
It was in a collection of other short stories, and it had a lot of footnotes, which still sticks out to me today, though I do not recall if the footnotes were part of the story or I was reading an annotated edition.