Separate Minecarts with Chests from Minecarts in Minecraft
In Minecraft, some players may want to separate Minecarts with Chests from Minecarts with a player inside them. Like in the real world, where there are passenger and freight trains, players with automatic farms or who need to move large amounts of items may also wish to use their Minecart tracks for freight purposes. This tutorial will aid those players on how to separate Minecarts with Chests from Minecarts while using the same track for both normal Minecarts with players and Minecarts with Chests.

This tutorial is part of a series since Mojang released the Minecraft gamerule maxMinecartSpeed
. This gamerule can make Minecarts faster, which makes them a much better option for travel in Minecraft than they used to be. The previous tutorial was Minecraft Railroad Switch – How To Build. You can see the whole series at Minecraft Rails.
Step 1: Setting up the Tracks to Separate Minecarts with Chest from Regular Minecarts
First, make a track that branches off the existing track, like below.

The design for the Redstone device that separates the Minecarts with Chest from the regular Minecarts changes depending on which direction they are traveling from when they reach the device.
Look at the image below and select the step corresponding to the direction you will travel from.
Step 2: Minecart with Chest goes Default Direction
Start by building walls on either side of the Minecart tracks, leaving one block between the rails and the walls. The walls should be next to the rail block right before the switch.
Now, place a tripwire on the second block of each wall. This tripwire will separate Minecarts with chests from Minecarts with players because Minecarts with Chests are only one block tall, but Minecarts with a player are two blocks.
Then, place redstone behind the wall and down one block to activate the track when the tripwire activates.

If you need your Minecarts with chests going the opposite direction, simply place a redstone torch rather than redstone wire on the block that touches the switch. The switch won’t update immediately. Walk through the tripwire to fix this.
Step 3: Opposite Direction
Begin by building two walls and a tripwire, as shown at the beginning of step 2. However, make the walls where the Minecart with Chest and Minecarts with player will come from before being separated.
Then, place a block on the side of the wall next to the switch. Place redstone dust on top of that block and a redstone torch on its side.

You may need to walk through the tripwire once for the switch to align correctly.
If you want Minecarts with chests to go in a different direction, replace the torch with more redstone wire.

Step 4: T-shape
Start by creating two walls and a tripwire between those two walls. That tripwire will separate Minecarts with Chests from Minecarts with Players because players are two blocks tall.
The walls should have one block of space from a rail on all sides.
Place a redstone torch on the side of the right wall, a block above that torch, and a torch on the side of that block.

Place blocks in a sideways L-shape just to the side of the railroad track. Place redstone dust on top of those blocks. This will complete the circuit and separate Minecarts with Chest from normal Minecarts.
If your Minecarts with chest need to separate in the other direction, break the bottom redstone torch and replace it with a piece of redstone dust on top of the wall.
Conclusion
This device will separate Minecarts with chests from Minecarts with players. Below is a demonstration of it working with a Minecart with chest:
And a demonstration with a passenger: