to sove this u need not find mkt dd function and indeed what u have found is not inverse mkt dd function.
to solve this question just write profit of first firm = p1(q1, q2) * q1 - m*q1
differentiate this wrt to q1 in order to maximise profit.
similarly write the expression for second firm and differentiate it with respect to q2.
u will get two equations with two variable, solve these, u will get the correct answer