First, make or select a brush shaped like the dashes you want on your road. In the brush settings, under Brush Tip Shape, there is a slider for spacing. Set it so that you get a dotted line; should be round about 200%. On the Shape Dynamics, set the Control dropdown box under Angle Jitter to Direction. Set Then stroke your path with that brush. If you select a round brush, you won't need the Angle control, of course.

You may wish to experiment with the other brush settings, but I recommend you set Size Jitter Control to Off so that it won't taper the ends of your line.