Someone should correct me if i’m wrong but i believe that if they are doing a motion type of action (walking, cycling, hopping) then it will be along the beach but if the action is not moving (stood, reading, talking) then it is on the beach.
Hope this helps.