Bassically I had:
- The "Pick ghost items if no item available" option set
- no rail ramps in myinventory
- but I did have rails and rail supports
To build real rails, I had to press 'q' on a rail (ghost or real) or manually select one from my hotbar or inventory.
I would expect the rails to be real if you have the real pieces, irrespective of whether or not you have a ghost in your cursor.
(A similar issue happens if you're in the process of hand-crafting a rail ramp, the cursor stays ghost even when the rail ramp is finished crafting).