I would characterize it as bidirectional.
Sometimes, due to genetics and the obesogenic environment, unhealthy weights develop, and then, as a result of stigma, mental health deteriorates. In other times, children who have been subject to child maltreatment—sexual abuse, physical abuse and that sort of thing—and children with biological tendencies to depression or anxiety can also use food for solace.
It's difficult to make categorical statements. You have to go individually.