You can duplicate rails and trap doors by placing a Sticky Piston one block away with a gap between them. Extending, retracting and extending a piston again cause a trapdoor\rails move onto and off a hole without breaking and drop a corresponding item.
Also works with Detector Rails and Powered Rails
Using this with a simple redstone clock gives you tons of trapdoors\rails
P.S.: This may be a simplified and extended duplication of
MC-1619, sorry about that