How do Gmail (desktop) and Talk (Android) chats interact?
To provide some background on this question, google talk uses xmpp (aka Jabber) which is an open Instant Messaging standard.  As a part of this standard, every instant messaging client (chat in gmail and the android talk app) is assigned a Resource.  The server then uses the resource to know which client is communicating.

This is how the interaction works:
Say your gmail account is bob@gmail.com.  Then gmail chat might be bob@gmail.com/gchat and 
the talk app bob@gmail.com/talk

When your friend Sue (sue@gmail.com) wants to send you a message, she simply sends it to bob@gmail.com.  At this point, the server either sends the message to whichever client you used last, or sends the message to all currently connected clients (google does the latter).

When you reply to Sue using the talk app, she receives the message from bob@gmail.com/talk.  Now, instead of sending further messages to bob@gmail.com, Sue's client now sends messages directly to bob@gmail.com/talk and will continue doing so until a message is received from some other client.

This means that what Saiboogu said should work.  That is, to switch between clients, send a message to the person you are chatting with from the desired client.



tl;dr: This happens by design, Saiboogu's workaround works.