Actually, in traditional Hindu society, before the influence of Muslims (say 1500 years ago and more), caste was not carved in stone; it was more a social system based on ability and qualities; not solely on birth. If you read the source documents that is quite clear.
There's a word - brahama bandhu, or kshatra bandhu - that means "friend of a brahmin" or "friend of a kshatriya" indicating someone born into a particular caste or social order but not qualified as such.
The caste system almost surely started out as a class system and was somewhat fluid.
But it has been hardening ever since, and became much less fluid than any Western class system could, as the doctrines of reincarnation and karma made the mistreatment of the lower castes entirely logical, right and proper, as it is punishment for sins committed in a previous life.
No society based on Judeo-Christian beliefs could ever be quite so calm about mistreating the lower classes.