DMV Permit Car Stopping - You are approaching an intersection, and just before the intersection, you encounter a set of railroad tracks. When should you stop before crossing the railroad tracks?

You are approaching an intersection, and just before the intersection, you encounter a set of railroad tracks. When should you stop before crossing the railroad tracks?