After arriving in the town, you'll be unfairly thrown in the jail. Talk to the mate form the cell and wait until the guard will stand back towards the iron bars. Grab him . Approach the door on the right  and use the action key on them several times. The door will open. Leave the prison and take all weapons from the desk.
Leave the building by taking the south passage and quietly move in east's direction. Be aware of the guard, which is carrying the torch. If he'll be far away, go behind stones to the horse standing nearby . Get on the horse and ride under the stone bridge  situated on the north.
Do exactly the same with two other horses standing in the town and in camps located on it's edges. When the animals will be under the bridge, sneak into the stable on the north , throw the whiskey bottle to torch the livery and quickly escape from there. It should be enough to distract the guards. Now, steal the powder keg from behind the powder shop in the centre of the town . Place one of the barrels near the prison's wall. Shoot it from a safe distance to free the prisoner.
Quickly jump onto the horse standing under the bridge and ride through the town with your comrades . Don't waste time and ammunition on shooting, just ride ahead until you'll reach the open area. One of the prisoners will separate from the group, but ride behind the other one. Finally, you should reach the hideout .