Yes... but it sounds awkward and would be considered poor English. Don't use the passive, use: "they were talking about the problem when we came in" - the active is much more common in this context.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.