The evolution of sapience does not occur because of the use of fire or the invention of cooking. That is an advancement made possible by sapience.
Rather, sapience evolves because of other factors, revolving around a need for complex thought:
A complex, dynamic social structure: Earth's most sapient species have a complex society. Social status may change depending upon relationships with others. Competition between individuals for higher social status exists.
A challenging environment requiring improvisation and/or memorization of the location of essential resources and storage of those resources: It is thought that early humans survived a period of extreme drought, requiring that they memorize the locations at which water may be found, and carrying and storing water for later use away from its source.
That said, I am not sure that the OP's species has what it takes to become sapient.
That they have a 'complex and hierarchical social structure' and biological castes with sterile workers suggests that while their society has a certain degree of complexity, it is not likely dynamic. Each individual appears to be born or raised into a particular role, and there is likely little prospect of changing caste or social status. Without the possibility of social conflict and a struggle for position, that's one major stimulus for sapience missing.
Secondly, there is no suggestion that their environment presents them any problems that they haven't been able to solve through their biological adaptations. Perhaps some resources are seasonal, perhaps they require discriminating senses to identify, but this doesn't require great sapience. It may require a bit, but once their level of sapience is sufficient, there's little need for more.
Ants and bees also have sterile castes and a potentially challenging environment, but they have adapted to overcome their problems not with sapience, but with cooperation. Resources may be difficult to find, but by having many individuals foraging and reporting the location of resources, others can come and assist in the task of harvesting. This is likely the case with the OP's species: they don't likely need sapience because all the smarts they need is to recognize resources when they stumble across them, and the ability to notify others as to the location of the resources. Ants do that with pheromones. Bees do it by dancing. Neither requires much brainpower at all.
That's not to say that a species with castes couldn't become sapient. It would require that the caste that an individual takes on is not fixed, but is the result of internal social competition. If there are sterile castes, their sterility must be temporary, and in the event of the death or demotion of a breeder through social competition, a sterile individual must be able to be promoted to being a breeder. By encouraging internal social competition, this applies an evolutionary pressure toward greater sapience.
Of course, the OP may want their castes to by physiologically distinct. There is no reason why this could not occur, as long as the physiological changes are reversible and/or cumulative, with the reproductive caste having features of other castes as well as the ability to reproduce.
Another pressure toward sapience would be a changing environment. Perhaps the ancestral forests are dwindling, perhaps there are floods brought about by climate change. This species has been forced out of their comfortable ancestral home, and must now improvise or die. Many of them will likely die, but those that can improvise will survive and reproduce.