This is designed to be a wheel block for your rolling stock. Good for holding a car in place on the work bench, or a few in place on level ground. Hold it on the rail, roll the wheel up on to it.
I recommend printing this with at least 25% infill since it will take some abuse, ABS would be good too but will work with PLA. The bottom side is curved to help accommodate the rail head. There is a small hole for you to attach a long bolt to so that you can have a better handle on it instead of grabbing the print itself.
I might modify this later to account for the wheel flange, but it works well for my intentions for now so I'm not going to worry. You also might consider gluing some thin rubber to the underside to help grip against the rail.