Google satellite view of Tilbury docks shows one part of the railway line into the docks running alongside the dockside for a short stretch, but (if my interpretation of the map is correct....) seems to suggest that containers are taken to land before being put onto trains.
https://maps.google.co.uk/maps?q=ti...5858,0.016512&gl=uk&hq=tilbury+docks&t=h&z=18
Standard practice. Containers are not stacked on ships according to the trains they will leave on. Factors such as the requirement for power for the Refrigerated containers, cargo compatibility (don't stack container A on container B where the contents, if mixed, will produce something nasty), loaded weight (if you stack all the heavy ones on top the ship could roll over) and dimensions (20 and 40 ft long are standard, but there are half height and 9ft, as against 8ft, high ones and 45ft and 53ft versions) all have an influence on where the boxes go.
Mix that all in with voyages that aren't between two points, so you have containers staying on board for the next port, or the port after that, and you get a situation where the make-up of the trains leaving the port isn't even on the radar when the ships are loaded and unloaded. Particularly as a very high proportion of the boxes will leave by road anyway and how and when the box will leave may not be known until after it's on the dockside.
Its easier to marshal the boxes directly onto the wagons using the Reach Stackers than load the wagons and then marshal the loaded wagons. The huge container parks are the modern day versions of the old marshalling yards that you used to see around ports.
Marchwood has a lot of rail yard as a high proportion of its traffic consists of vehicles that require specialist securing, loading and unloading arrangements. Containers are carried but they are usually simply stacked in the vehicle lanes of the RORO's and RFA's rather than carried in the container cells or stacks of specialist container ships.