Of course racism is learned. But actually kids spend far more time in school, far more time with friends than with their parents. They are influenced by these, plus their sports coaches, and other family and anyone else they interact with.
They are also influenced by media, and now social media. Social media is the big digital disruptor in all our lives, and probably the biggest influence for many adults and kids sadly. It's been weaponised by right wing hate groups and has influenced many people, with a barrage of targetted misinformation, and hate. Things will only truly get better when appropriate digital laws exist to create good governance, we are sadly in the age of misinformation.
No one thinks that racism went away, only that it had reduced, but now it's increased again. Austerity has made people angry and resentful at what they don't have, social media led by Tory PR told them it was because of immigrants from europe as a diversion from the bankers who were sneaking out the back door with the family silver tucked in their jackets. People needed someone to blame and Polish, French and the good old Germans were the first target. We had a rise in islamaphobia after the manchester bombing and now hate towards Black people due to BML. Now it's anyone from teh far east that might look a bit 'wuhan-ese' that get it. Basically there have been targeted social media led hate campaigns against every key ethnic group except the south americans in the last 5 years. The peope were ready to blame, and the right wing PR stoked it.