Should have confronted with them at the first place, which can set a good example for your kid and at the same time, embarrass those racists.
Always be courageous, polite and clam but very firm and assertive.