Let quantities taken from container 1 and 2 be \( x \) and \( y \) respectively.
Container 1 (5:1) ⇒ A = \( \frac{5}{6}x \), B = \( \frac{1}{6}x \)
Container 2 (1:3) ⇒ A = \( \frac{1}{4}y \), B = \( \frac{3}{4}y \)
Total A = \( \frac{5x}{6} + \frac{y}{4} \),
Total B = \( \frac{x}{6} + \frac{3y}{4} \)
Given A : B = 1 : 1, so:
\[
\frac{5x}{6} + \frac{y}{4} = \frac{x}{6} + \frac{3y}{4}
\]
Multiply by 12:
\[
10x + 3y = 2x + 9y \Rightarrow 8x = 6y \Rightarrow \frac{x}{y} = \frac{3}{4}
\]
So, required ratio = \( x : y = 3 : 4 \Rightarrow \boxed{4 : 3} \)