I think the animation was made back in the USSR, so possibly before 1990, maybe in 197x-198x. Russian language. Duration is about 10 minutes, possibly B&W. Seen on TV. One of the boys is a good pupil, the other is not (lazy), and the whole animation is about knowledge.
I do remember only one scene: at some point kids appear in a sand desert (possible teleported there by the robot-teacher).
They want to get to home and so considering their options. We also see that "robot-teacher" is watching them from behind the distant barkhan (or sand-dune).
"Lazy pupil" tries to pick up a spider, but "smart pupil" tells him not to:
"Don't touch! It's black widow, its poison is 15 times more dangerous than snake venom".
"Lazy pupil" obeys, but starts to tremble, and presents another spider (out of his pocket).
"Smart pupil" tells him not to worry, because it is just a small solifugae (not poisonous).
Then "smart pupil" sees that he stands on a kind of a "firm sand" and exclaims "this is the caravan route, we saved!", and so "robot-teacher" teleports them back to school.
EDIT: Drawing style is a similar to that one, may be a bit more "sketchy":
EDIT2: someone else looks for this cartoon, on another site, and so I am adding the following quotes found in that another post, russian:
"Smart pupil": I was assigned to help you to pass exams (in russian it sounds like "меня прислали подтянуть тебя", which could be translated like "I was sent to pull you up", i.e. icrease your level of knowledge).
"Lazy pupil" (hanging on the horizontal bar): "And, as you can see, I am pulling up".