Part Identification - bricks with posts
The black piece is part of a steering mechanism, part of 377-2: Crane With Float Truck. Here it is on BrickLink.



Like Windfire says, the red part is a direction switcher. You can see the switch on the side of the battery car.