A federal court in Virginia issued a temporary restraining order saying permanent residents returning from overseas should have access to lawyers while they are being detained and cannot be removed for seven days.