I am not aware of any carrier, online booking site, or aggregator that will book a single reservation for two travelers with non-identical itineraries. Thus, two separate reservations will be needed.
There are two ways to approach getting adjacent seats with separate itineraries. The first is for one of the travelers to make both reservations, one immediately after the other. First, select a seat on the B > A flight with an adjacent empty seat. Then, when booking the second itinerary for the other travelers, select that adjacent seat. This could be done either through an online portal or aggregator, or directly through the airline.
Sometimes unsold seats are shown as "unavailable" because they've been allocated by the carrier to its code-share partners. The best shot to secure adjacent seats is by booking both itineraries at the same time with the same portal, or aggregator, or code-share partner, or carrier.
A second tactic is to buy separately, but in coordination. My wife and I have successfully done this many times. We sit at adjacent desks in our home office (and have also done it by phone or message when we're apart), book concurrently using the same source, select adjacent seats, and press "buy" at the same time.