Terminal A and B are just the two sides of the building; the doors (and airline counters) on the north are called A and the doors (and airline counters) on the south side are called B. You can just walk around in the building, once inside, the difference does no longer exist.
However, there are two ends - west and east - of the building, where you ride on trains (called APMs ‘automated People Movers’) to four different gate areas - two per side.
Both ends have their own security, the west side is gates 1 to 69, and the east side is 70 to 129. You can freely walk between the gates on the west side; on the east side, you cannot ride one train back and the other forth, because international arrvivals come through the gates 70 to 99, and if you return in the train from gates 70 to 99, you must leave the secure area.
Note that you also cannot go in the secure area in the east if your ticket is for the west, and vice versa.
From your description, and from where I know the two airlines have their gates, you will not be able to walk between those gates without passing through security again - if you ever make it in on the ‘wrong’ side.