A quicker route is to scale the total amount to the LCM of the two ratio sums so both shares come out as whole numbers straightaway.
Correct ratio $2:3:4$ has a sum of $9$ parts, and the wrong ratio $7:2:5$ has a sum of $14$ parts. Take the total amount as $126k$, where $126 = \text{LCM}(9,14)$, so it divides evenly under both ratios.
Correct B share $= \dfrac{3}{9}\times 126k = 42k$.
Wrong B share $= \dfrac{2}{14}\times 126k = 18k$.
The shortfall is $42k - 18k = 24k$, and this equals the given Rs 40, so $24k = 40$, giving $k = \dfrac{5}{3}$.
Total amount $= 126k = 126 \times \dfrac{5}{3} = 210$, confirming option A.
\[\boxed{Rs. \ 210}\]