Let the original counts be red = 2k and blue = 3k, matching the 2 to 3 ratio.
Blue is untouched by the addition, and red becomes 2k + 10, so the new ratio gives (2k + 10)/3k = 4/3. Cross-multiplying: 3(2k + 10) = 4(3k), so 6k + 30 = 12k. Subtracting 6k from both sides gives 30 = 6k, so k = 5.
Then red = 2k = 10 and blue = 3k = 15, and the original total = red + blue = 5k = 25.
You can also anchor on blue, since it never changes: blue is 3 parts in both ratios, and 3 parts = 15 marbles, so 1 part = 5. That gives the original red = 2 × 5 = 10 and the original total = 5 × 5 = 25, matching the algebra.
The question asks for the original total, not any of the values that show up partway through the solution.