Newton's 1st Law of Motion explains why a bike coasts: I. Every object in a state of uniform motion tends to remain in that state of motion unless an external force is applied to it.
Your friend's bike has less friction at the road (the external force) and thus continues in that state of motion longer.