The problem statement says that, "Because of the randomization, the two sample means are independent."
Whether these means are independent depends on what is being viewed as random and on details that aren't mentioned, but the implication that the random assignment will result in independence is wrong on any interpretation.
If the set of 40 chicks is taken to be fixed, with only the assignment to groups being regarded as random, then the two means are certainly not independent. For instance, if there is one very unusual chick, which will raise the mean of whatever group it is in by a lot, the two means will be negatively correlated, since if this chick is in one group it won't be in the other.
In this scenario, the randomization may well allow a meaningful comparison to be done, but not because the two group means are independent with respect to the sample space describing this randomization.
If the set of 40 chicks is regarded as a sample from a larger population of interest, then a failure to draw the 40 chicks independently from this population will not be cured by random assignment to groups. For example, if one barn is contaminated with toxins that affect the chicks' health, and all 40 chicks are drawn from a single barn (chosen at random), then either both group means will be affected by the chicks coming from the barn with toxins, or neither group mean will be affected.
All one can say is that if the 40 chicks were drawn independently from the population, the random assignment to the two groups will result in the two group means being independent. That is, randomization ensures that no dependencies are introduced by the assignment to groups; it can't cure a lack of independence in the original sample.