This is easy. Pick up the phone tomorrow, and contact the HR ('staffing department') person who is handling your recruitment (not the guy who will be your manager if you pass the interview, but the one doing the scheduling). Tell them that you've recently discovered that the company has an office at location two, and as a location you would be more interested in it than location one. Don't say you aren't interested in location one. Then ask her the important questions: does location two do the kind of work you are interested in? Are there any openings there? Is it the same manager responsible for that function in both places? Get details of what kind of work takes place at each location - just because two jobs have the same job title doesn't mean you would be doing exactly the same work there. If there might be openings, ask if you could interview for a position there either at the same time or shortly after the interview you have scheduled?
The questions I've mentioned, and any others you can think of, should give you a much better idea of whether getting recruited to location 2 is reasonable, and whether it is best for you (even if the location is more convenient, the job at location 2 might be worse). Find out from the HR guy if you need to make a separate application for any job there, or whether the one application works for both locations. If you still would prefer to work at location 2, either make a second application or make your interest and preference for location 2 clear.
Then go to the interview for location one, and give it your best shot without reservation. If you are asked, tell any interviewers that geographically location 2 would suit you better, but you would consider a job at either. If you are invited to an interview for a job at location 2, do the same there. Then see what happens.