I generally understood the story based on the Malbim: obviously, everyone involved (including "Woman B," as you call her) knew that King Solomon's suggestion would result in the death of the child. After all, the second woman says גם לי גם לך לא יהיה - neither of us would end up with a child. 

Instead, the question was what do each of these woman *really* want out of this trial? Woman A (the child's mother) is obviously most interested in keeping her baby, but King Solomon recognized that the other woman was motivated by a desire to even the scales: she was upset by the fact that her child had died while her companion's child was alive. As they say in English, "[misery loves company][1]," or in Hebrew, [צרת רבים חצי נחמה][2]. The woman who was not the baby's mother wouldn't actually have said out loud that she wanted her friend's baby to die, and so Solomon had devised this "test" in order to get her to express what she was really after. 

Here's the commentary of [Malbim][3] to King 3:22, who shows that the wording of each of the two women tipped off King Solomon to the solution: 

> **ותאמר האשה האחרת לא כי בני החי ובנך המת וזאת אומרת לא כי בנך המת ובני החי**, ספר הכתוב כי בדברם, אמרה הנתבעת בלשון **בני החי ובנך המת**
> והתובעת אמרה בהפך **בנך המת ובני החי**, וכלל בלשון שהאדם יקדים תמיד מה
> שהוא העקר ויאחר את הטפל ולפ''ז הסברא נותנת שהאשה שדקדקה להקדים בלשונה
> **בני החי** קודם עקר מגמתה שיהיה החי בנה, והמקדמת בלשונה **בנך המת** עקר מגמתה שיהיה המת בן חברתה, לא שיהיה החי בנה, ומזה כבר היה יכול
> להבין ולהכריע מי אמו
> 
> "**The other woman said, 'no rather it is my son who is alive and your
> son who is dead,' and this one says 'no rather it is my son who is
> dead and your son who is alive**." 
> 
> Scripture tells how regarding their words, by one claimant using the
> language of "***my son is alive and your son is dead**,"* and the
> other claimant saying [in] the reverse [order], "***your son is dead
> and my son is alive***." There is a rule in man's language that he
> will always give precedent to what is primary and make later what is
> secondary, and therefore it is reasonable that the woman who was
> careful to give precedence in her words to ***my son is alive***-her
> main objective is that her son be alive, and the [other woman] who
> gave precedence to ***your son is dead***- her main objective was to
> say that the dead son was her companion's, but not that her son was
> the live one. And from this [Solomon] was already able to understand
> and discern who is his mother

Thus, once it was clear to Solomon that the second woman was more interested in making sure that her fellow was the one subject to having a dead child, he was able to exploit that fact by showing that she would be fine with such a verdict - even at the expense of a child's life.



  [1]: https://idioms.thefreedictionary.com/misery+loves+company
  [2]: http://forum.otzar.org/viewtopic.php?t=19841
  [3]: https://en.wikipedia.org/wiki/Malbim