I just want to say that I did exactly this when I was a kid, and I had selective mutism. I felt (was?) incapable of speaking up, and when someone told me to speak up it caused tremendous stress and made it that much less likely that I'd be able to do so. I would definitely not recommend telling a child with this problem to talk more loudly. I would recommend putting the child in the front row so that the teacher can hear more easily, but otherwise ignoring it, or employing anxiety-reducing strategies like those used for selective mutism.