Building on what Nicola said, imagine substituting 'which' for 'a'. It would not make sense to say "on a room", in should be "in a room", so we should say "in which".
You would get off 'at' a train station, so we would say "at which train station should I get off?" if we were asking someone where to get off.
Things are located on tables, "on a table", so you would say "on which table is it located?". It is the same for anything, if you are looking for something under a table it would be "under which table?".