Steam Family sharing - Overlapping shared libraries
Solution 1:
As Scott Weldon said, there doesn't seem to be any way to do this other than disabling sharing of the friend whose library is in use, or using offline mode as Jaxir said to prevent the library from being in use in the first place. You can change the order in which your friends share libraries with you by having them unshare and reshare the library with you, in order to play your games with the library of whichever friend is least likely to be using it, but for a general solution to choose which friend's library to use, you'll need sfs-select.
SFS-select is a python tool to enable and disable friends' shared libraries by modifying the local cache remembering which accounts have authorized you. It's a bit of a clunky workaround, but it lets you pick exactly which friend's library you would like to use for a shared game, without needing your friends to log in to your computer again, or changing the actual permissions registered on the Steam server at all. It includes both graphical and command-line versions. You can download it here or read about it on the Steam forum thread.
Solution 2:
I had the same problem. Unfortunately, this seems to be by design. I don't have a solution, but I do have a workaround: temporarily disable the sharing of user A's library with you, and you will be able to play user B's copy of the game.
This is rather inconvenient though, especially if this happens frequently (or if you have several shared libraries with the same game), so hopefully Valve gets this fixed.