I think you could say either, but the second is more common. The first one makes it clearer you are asking which one of them is their friend, and implies it's only one of them. The conversation before that would have had to have been about Jane and Ann.That's an unusual thing to ask, so it doesn't sound as natural, but it seems ok if the context is correct. The second one is asking about either or both and is a more common thing to say. It wouldn't require much context for them to know what you are asking about.