If one of the creatures is an illegal target and the other one isn't as The Earth Crystal's last ability tries to resolve, the original distribution of counters applies and the counter that would have been put on the illegal target is lost. It won't be put on the remaining legal target instead.