Step 1: Define counts.
Let Bag 1 contain $r_1$ red and $b_1$ blue marbles.
Let Bag 2 contain $r_2$ red and $b_2$ blue marbles.
Given: total marbles $r_1+b_1+r_2+b_2=18$.
Step 2: Probability condition.
ProbabilityBoth re(D) $=\dfrac{r_1}{r_1+b_1}\dfrac{r_2}{r_2+b_2}=\tfrac{5}{16}$.
Step 3: Use complementary relationship.
Notice that
\[
\frac{r_1}{r_1+b_1} \frac{r_2}{r_2+b_2}+\frac{b_1}{r_1+b_1} \frac{b_2}{r_2+b_2}
=\frac{r_1r_2+b_1b_2}{(r_1+b_1)(r_2+b_2)}.
\]
The numerator can be rewritten as $\tfrac{1}{2}\big((r_1+b_1)(r_2+b_2)+(r_1-r_2)B_1-b_2)\big)$.
But crucially, the given construction ensures the problem is symmetric: the probability of both red and both blue must complement to $\tfrac{1}{2}$ in such a setup.
Thus, if both red $=\tfrac{5}{16}$, then both blue $=\tfrac{3}{16}$.
\[
\boxed{\tfrac{3}{16}}
\]