A lot of SF and fantasy writers don't like the problem. You get the most improbable abilities to interbreed, even among beings that evolved independently in separate star systems.
But unlike earthly caste systems, where the most valiant attempts to prevent interbreeding have failed, these ones would enforce themselves. Perhaps they would be encouraged for those who did not want children, or were not wanted to have children, but that use would, obviously, be self-limiting.
Much would depend on the respective characters of the races. If dwarves were the fantasy stereotype that firmly stuck to mining and metalwork, or something like, it would sort by occupation. If it were Advanced Energy Beings of Great Wisdom, it would be a caste of higher or lower.
What would their interactions be like? How would the pressure of politics go? When Lucius Volumnius became the first plebian consul in ancient Rome, he was married to a patrician wife. Leading to an ugly scene when she was barred from a ceremony for Patrician Virtue because her patrician birth did not suffice -- but not half so interesting as the situations where there could be no connections between the patricians and plebians, whatever they are. Reminds me of Augustine's explanation for incest taboos: to force people to enter into new relationships, instead of doubling up on their old ones.