There are several things you have to consider in this case.
If you are playing CW2 or a newer game, the auto-OP rule has to be considered. I'm assuming that this is the case.
The auto-OP rule states, that if your stack finds itself in a region --whether it starts there, or it is move into it-- where you have <5% MC, if that stack is currently in DP it will automatically change to OP and you side will immediately have its MC changed to 5% MC.
This will cause your stack(s) to attack any enemy in the region.
I'm assuming you already have >= 5% MC.
The next thing you have to consider is that enemy in the region exert a ZOC over stacks attempting to exit the region. You didn't think you get to walk away from an enemy stack just like that did you?
Simply stated, if you select the stack you wish to move 'past' the enemy stack in region A, and region B is overlaid in red, the enemy's ZOC in region A is preventing you from entering region B with said stack.
ZOC blocking is different for each stack. A small stack with just cavalry (great evasion values) will evade an enemy in the same region to be able to enter the next enemy region. A fat corps with slow lumbering supply-trains will not be able to evade the enemy to enter another enemy held region.
The formula for calculating this is: if (enemy patrol value/friendly evasion value) > (your military control + (2 * friendly evasion value)) the enemy blocks the move in question. This is very vague, but it gives you an idea. Evasion value, is the lowest evasion value of any friendly unit in your stack. So like 1 for a supply train.
You cannot affect 'enemy patrol value'. You can however influence your moving stack's 'evasion value', by putting only elements with a high evasion value, like cavalry in the stack.
You can also increase your 'military control' by fighting the enemy in region A, but you want to insure your other stack gets away. So you need a maneuver stack, with high evasion value, and a battle stack, with high offensive power.
Your battle stack needs at least 1.5x offensive power to the defenders defensive power, to saturate the defender, which means your maneuver stack in DP, will not be called on to help fight. the enemy. Set the battle stack to OP for it to attack the enemy, which will likely gain you some --probable a lot-- of MC, making it very likely that your maneuver stack can exit region A and enter region B where I assume you have 0 MC.
But you want to attack the garrison inside the city in the next region this turn, which means your maneuver stack MUST be in AP (Assault Posture). But being in AP is the same as OP when in the field, which means there is a 50% chance your maneuver stack might be chosen to to attack the defending stack in region A. If your battle stack attacks, since its attack will saturate the defender, the battle stack will not call on any assistance in fighting, and the maneuver stack will be excluded, and get to move out of region A and into region B, where it will assault the garrison in region B.
So, it is not very likely that you could attack the garrison in region B this turn, but you could well get there this turn, to be able to attack in the next turn. I think that might be the best you can do.
I'm not sure what will happen if your maneuver stack fights and your side wins. If you win the battle convincingly enough your maneuver stack might just continue moving and attack in Region B, but I wouldn't bet my live on it.