How can it be established that the mass of one of the bogies is greater and the other is less?

If, after the interaction, the speeds of the initially resting carts are the same, then their masses are the same. If their speeds are different, then a trolley with a lower mass will have a higher speed, and a trolley with a larger mass will have a lower speed. And the paths traveled by these carts will also depend on the mass.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.