Even assuming depression must be "learned", what does it matter? School can't make sure they're never around depressed people. But it can help them protect themselves from it.
Other kids? Childhood bullying is very, very common, and is a big driver of this sort of thing. Social media may have made this even worse, but it's always been a thing.
It's not learned. It happens because other children are cruel, we do not prioritize healthy environment for them, and because there is an enormous pressure from social media from a young age.
No-one credible uses brain chemistry as an explanation for depression (unless you're talking about bi-polar). The emphasis is on the psycho-social bit of bio-psycho-social.
"Homeless Chicago man suffering from hypothermia makes miraculous recovery after someone from Wisconsin informs him 'it's actually much colder where I'm from'"
Depending on a situation I can do that as well. I do not exclude any possibility, what will work - I will do. Whatever "kinds" of people you invented - this is only your own problem.