You could make a custom brush, but I think you can get what you need simply by applying a dashed stroke.
It's hiding in the Options of the Stroke palette. (In the Stroke palette, if you don't see options for a Dashed Stroke at the bottom, bring up the palette's flyout menu and say Show Options).
Apply a stroke, turn on Dashed Stroke, then play with the stroke weight, dash length and gap length until you get the proportion of rectangle that you're after. To get railroad-trackish proportioned rectangles, you'll need a fat stroke and a short dash length.