Automatic wireless system and method for controlling vehicles at an intersection