I am going to assume right side traffic for this question. Switch all the left and right if you are in the UK. If you are cycling on a road with or without a designated bicycle lane you should stick to the right. If one cyclist wants to overtake another they should do so on the left, the same way cars pass each other. Of course they need to check whether the road is sufficiently free and it is safe to overtake and this is the faster cyclist's responsibility.
Now consider a bike path on the sidewalk. A typical arrangement would be as follows (in Berlin, Germany) when looking in the driving direction:
┌───────────┐
│ │ │
│ │ ┌─┐ ┌─┐ │
┌───┬─┐ │ │ │ │ │ │
│ │ │┼┼┬─┐ │ │ │ │ │ │
│ │ ┌─┼┼┼│ │ │ └─┘ └─┘ │
└─┼─┼┼┼│ │ │ │
│ │ │┼┼┼─┘ │ ┌──────┐ │
│ └─┴┼┼┘ │ └──────┘ │
││ │ │
│ ┌────┐ ┌────┐ ┌───┐ ││ │ ┌──────┐ │
│ │ │ │ │ │ │ ││ │ └──────┘ │
├────┤ ├────┤ ├───┤ ││ │ │
│ ───┴────┴─────┴────┴── ─┴───┴─ ─┴┴─ ───── ────────────── └───────────┘
│
car road parking tree bike pedestrians houses
The dashed line on the left indicates that it is mirrored on the opposite side.
Now a typical bike lane is not wide enough for two bikes to pass each other so one bike has to go on the pedestrian sidewalk (and check that it is free and save to use). StreetView shows the situation as follows:
If you overtake on the left that means the slower bike needs to move to the sidewalk to allow the faster one to pass. This seems odd because the responsibility should lie with the faster bike whereas the slower one can just mind their own business.
If you overtake on the right responsibilities lie where they should but the rules suddenly change depending on how the bike lane is build.
In practice I observe both which especially for a slow, somewhat insecure child cyclist can be confusing and feel unsafe. It also makes me as a parent wonder what to recommend: stick to the left/right/center of the bike lane? React somehow if they notice someone behind them?
Here is a google satellite image of the configuration in Berlin. The bike lane is just north of where the shadows of the parked cars are. The pedestrian sidewalk is quite wide, maybe 4 meters which is not untypical for Berlin. Hence cyclists often use it to overtake and can do so without inconveniencing any pedestrians.