They will not go back but will wait for the next vehicle going the right way. The station GUI will show not merely pax waiting but pax waiting with a desired destination. (For instance, conditional orders don't work.) Now you can arbitrarily run A-B, B-C with pretty much any orders and frequency. This is slightly buggy and has some limitations, which is why it's not in trunk. You might timetable both lines although this will interact poorly with 'full load'. If there are several vehicles on each line and a B-C is waiting when another B-C arrives then again, those pax will go right back where they boarded.
Town B must supply some pax to both lines since there will be some loss: a full load B-C won't quite make by itself a full load A-B. This is tricky and requires a lot of fussbudgetry. If there were no waiting A-B then, yes, the B-C will pick up the pax it just dropped. The A-B will pick up the pax dropped by the B-C so the latter in its turn must wait for the next A-B.
If there is sufficient capacity on each line and your timing is good, there will be an A-B vehicle waiting at B when a B-C vehicle transfers, which is to say cargo unloads but will not be accepted at B. (1) Advanced Settings > Stations > Use improved loading algorithm > ON and let, for both lines, the order at intermediate station B read Transfer and wait for full load. For clarity, let's say that there are three towns, A, B, C, each with a single logical station (which may be, say, a bus station joined to a train station or dock).
I'll offer two approaches to bidirectional feeder service with a single intermediate station.