Child suffered anxiety, nightmares and had a fear of crossing the road for a while after the incident, court hears