The Late Roman Republic was a lot like what you are asking about
Ancient Rome had a rigid caste system, with representative government very much like what you describe. While the Senators were technically elected positions, you had to be of the Senatorial Class to be able to run for or vote for Senate positions. Since the Senatorial Class were just the original 30 family lines that founded Rome, VERY few people in Rome could actually participate in the Senate elections.
Over time, a number of civil wars forced the Senate to grant more and more citizenship rights to its allies; however, since Senate Law held Supremacy and the Senatorial Class class was too small to maintain any authority if outsiders were allowed to participate in the Senate, they created a number of lesser councils based on other social classes. The lower councils were allowed to pass any law that did not contradict Senate law; so, in this way the highest caste actually maintained totalitarian control over the republic in every way that mattered to them, but allowed the lesser councils to rule themselves in every way that they did not care enough about to pass laws.
How your system could similarly work
The Council of Science is made up of scientists elected by scientists. Any law they pass supersedes all other laws in a court of law. In general, the Council of Science is expected to restrict its laws to matters of scientific significance, but since EVERYTHING can be evaluated as being scientifically significant, there is no real limit to their authority.
Below that you have the Council of Security which is made up of soldiers, police, etc and elected by their own. The Council of Security in theory has authority in all things related to maintaining the peace and protecting the nation. Because it is considered so important to protect the nation, they have the authority to overrule the lesser two councils to make sure that individual rights don't put the nation's security in jeopardy, BUT their laws are superseded by the Council of Science because it is assumed that even in matters of the military, scientific exactness is more reliable than a soldier's intuitive experience.
Then you have the Council of Artistry which is made up of entertainers, artists, musicians, etc. The expected role of this council is to make sure that the general happiness of the people is maintained. So, they govern things like sporting leagues, news stations, etc. Since their area of focus is mostly the dissemination of information they would be very powerful except that the higher two councils can overrule them at any turn. So, higher councils are seen as necessary to make sure that all that flow of information is "true" according to the Council of Science and "Safe" according to the Council of Security.
Lastly you have the Council of Labor whose job it is to oversee welfare and workers' rights... but they can only do so in the very narrow confines of what the other 3 councils allow. While "Workers' rights are important *wink*", the upper 3 castes must make sure that labor rights still produce a statistically favorable economy as per the Council of Science, that they do not endanger the the nation as per the Council of Security, and that the needs of the individual do not supersede the needs of the community as per the Council of Artistry. In this respect, they would be very hard pressed to get anything like over-time or universal healthcare or anything that would prevent the upper castes from exploiting the hell out of them, but they could probably make sure that workers at least have basic safety standards similar to OSHA.
As for maintaining a caste system in an advanced society:
This social order is all easily justifiable and easy to indoctrinate into a society as the RIGHT social order as shown above, but in reality, it actually has nothing to do with why anyone should have more authority than the next. It is all designed to make sure the scientists give everyone only as much power as it takes to prevent a successful uprising. By putting the military in second, they give them the least reason out of any lower class to rebel; so, those who have the power to overthrow the scientists generally will not want to. Then the artisans are given just enough power to not wish to speak ill of the government, but not enough raise the people against it. Lastly the laborers are given just enough authority to feel like they can participate in their self-determination too, but few concessions are needed to keep this most vulnerable class in check.
Historically, castes were maintained via parental apprenticeships. Each boy learned the trade of his father making sure that his education would only be appropriate to be the same caste as his father. However, it's hard to have an advanced society without public education. So to solve for this, your civilization will have 4 distinct educational systems. So, if you are of the scientific class, you enroll in an academic school system. If your parents are soldiers, you go to military school. Artisans send their kids to various kinds of trade schools. And lastly, laborers don't need school; so, they go directly into a career path as soon as they are old enough to have jobs.
By doing this, you can make sure that each caste lacks access to the education needed to vertically advance.