Supporting sliding ladder rail from sides of small closet?
I'd put ledgers on the walls to the left and right of the shelves.  By this I mean a board running horizontally the entire length of the wall, screwed in at the studs.  This will give you something with some strength and stability to attach to.  

You could run a steel pipe across from ledger to ledger, attached to the ledgers with floor flanges.  I can say I have used 1" pipe and floor flanges this way for chinup bars many times and they held up well.  

The weak point of the pipe is the threaded part, if it shears off it will be at the threads near the floor flange.  If you want to be safe, run a 1" dowel inside the pipe.  Even if the metal cracks, it's not going anywhere.  

If the pipe is not sufficient, you could run a board across from ledger to ledger, just like a joist - you might even use joist hangers to fasten it to the ledgers.  That would give you the surface the ready made rolling ladder kits want.  Joist hangers are made to carry weight vertically, not horizontally, but I think they'd be strong enough for this purpose.  If you want something stronger in the horizontal direction, that's easy enough to work out.