Problem #1 = gates open for 50% of the time and closed for 50% of the time, so gates must have a fast motor to reduce actual rotation time. Three methods spring to mind :- 1. Reversing motor & gearbox with end limit switches. 2a. Solenoid with spring return, 2b. Two solenoids. 3. Rotary solenoid/90 degree motor. Take the armature out of a small DC motor, replace commutator with flexible wires, mount with two magnets at 90 degrees to each. Pulsing each winding will twitch the motor so the live armature winding will pull into its magnet.
with each system, if you use two timers running of sensor to allow dwell time either in closed or open position.
Problem #2 I do not believe that ultra sonics is accurate enough to stop car in the right place. I would put a mirror on the centre of each gate and use on the car a mini laser to throw a spot on it( modulate the laser with an audio tone) and a photo electric cell to detect if the gate is open or not. Mount the laser on one side of the car at an angle so that you only get a reflection when the car is (say) 30cm from the gate, else the car will stop 1m from mirror, then will have to charge at it to get through before it closes. Also it gives clearance in case the gate opens towards the car.
frank