you are correct. That's why they don't really compete with each other. You put it on a train for a long distance and then trucks pick it up to spread it out from there.
I think any definition of competition must be relative to the sphere of economic activity. So, when it comes to transportation in general, rail and trucks do compete -- by this I mean they offer services with varying prices and characteristics.
Just because rail and trucking have different sweet spots at a particular point in time does not mean that they don't compete. Both (a) think about how and why customers choose them over the other, (b) seek opportunities (for investment or growth) that lead to a competitive edge, and (c) therefore, influence each other.