Applicants who have waited more than 120 days from their initial interview for a decision on a stalled naturalization application (N-400) have the option under Section 336(b) of the Immigration and National Act, 8 USC § 1447(b), to file a lawsuit.
The statute is specific:
If there is a failure to make a determination under [INA] § 335 [8 U.S.C. § 1446] before the end of the 120-day period after the date on which the examination is conducted under such section, the applicant may apply to the United States district court for the District in which the applicant resides for a hearing on the matter. Such court has jurisdiction over the matter and may either determine the matter or remand the matter, with appropriate instructions, to the Service to determine the matter.
Basically, a delayed naturalization case must be filed in federal district court. The statute even specifies the “venue” (i.e., the actual courthouse) and states that it must be filed in the “District in which the applicant resides.” In general, a plaintiff can only file the case where they live.
Complicated situations can arise if the plaintiff is in custody or lives outside of the US. Also, some courts have interpreted the quoted language to be jurisdictional as opposed to a simple matter of venue. That means that instead of transferring your case to the appropriate venue, some federal courts will outright dismiss your case if it is filed somewhere other than where you reside.