Four days after a fencing dispute led to its closure, both countries agree to reopen the crossing for thousands of stranded passengers.