Yes, not nearly. Not anywhere close to the complexity needed for self driving cars. Trains run on closed, limited, well-signaled infrastructure, which (comparably) makes it fairly easy to "avoid other trains" (as long as the signaling, coordinated externally, works--if it doesn't the train is likely programmed to just stop until it does again).