If your ebike runs out of battery, you can simply continue riding. The motor on the ebike only assists your pedaling (instead of doing all the work), so you can continue riding as usual without the pedal assist.