Are my hardwood sleepers shrinking?
What you are showing is bare wood apparently without any treatment or coating.  In that case the wood will shrink and swell due to humidity and, since this appears to be outside, rain, snow, etc.
Wood changes dimensionally the most at right angles to the grain.  In your case the grain is going horizontally and so the dimensional changes will happen most in the vertical direction.  That, of course, is exactly what you are seeing.
If you don't want this to happen, there are two options that I can think of:

Treat the wood (usually this means primer, paint) with a product that will seal it against humidity and moisture.  This will likely need to be redone periodically.
Replace the wood with a product that is not subject to moisture.

Otherwise, what you have is entirely normal.  You could just live with it as it is.