The gravitational force on a body is proportional to its mass $F\propto m$, so the acceleration $a=F/m$ that it produces is independent of the mass. This means that the trajectories of bodies in gravitational fields (without any other forces involved) don't depend on their masses and thus we can't find the latter using any information about the former. So the answer is no.
If you managed to measure the acceleration of the objects due to other kinds of forces you could get more information. If you measure the acceleration $a$ produced by a known force $F$, you can get $m=F/a$. Even if the force is unkown but mass-independent, it is possible to find ratios of masses of bodies as $m_1/m_2=a_2/a_1$ when both are accelerated by the same force.
A force that probably appears in a physics engine is friction, but obtaining information from it can become hard if you don't know how it is modeled. A simple force that might help you and could appear in the engine is that of a spring. It should be $F=kx$, so from the knowlege of $k$ you can use it to determine masses and even if you don't know $k$ you can use it to find ratios as explained above.