Streetcars are a unique mean of transportation in Red Dead Redemption 2. They appear only in Saint Denis, the biggest city in the game. This page of our guide for RDR2 informs you whether Arthur can drive a streetcar or not.
Sadly, you can't drive a streetcar in Red Dead Redemption 2. Arthur can't change the direction or the speed. In theory, you can enter a streetcar, and kill its driver (this also makes you a target for the local law enforcers) but the main console will remain inactive.
As a consolation, you can use streetcars to travel around Saint Denis. This eliminates the risk of hitting a pedestrian while you are riding your horse. You don't have to stand in a streetcar - Arthur can sit in one of the chairs. Another thing you need to remember is that, just like with trains, Arthur can jump into a streetcar while riding a horse.