Ejectors will kick the player out of a minecart when the minecart passes over the ejector control block. By default, ejectors are made out of iron blocks. Players will be ejected to the same position as the ejector control block, but you can change this behavior by putting a specially crafted sign post 2 or 3 blocks under the track piece. This sign post must have [Eject] on the second line and face away from the direction that you want the player to be ejected to. Players are only ejected one block away and diagonal directions are supported.
Redstone can be used here as well.