What type of world are you thinking about? In the story Flatland, the two dimensions are much more similar to a "top down" type of world. In this world, there is no gravitation so there cannot be a gravitational mass. In this world, others have answered how to calculate the inertial mass.
However, if you want universal gravitation, then it might be more appropriate to have the two dimensions resemble a "side view" world, one more like the first Mario game. In this world, you can have one large mass act as a planet, and have processes like locomotion be easier to define than in Flatland.
Two ways to measure gravitational mass in reality are:
- A spring scale
Where a mass is placed on a spring (on the ground) and the compression of the spring determines the force applied (the weight of the object). Anywhere the force of gravity is the same, the weight will be the same (excluding charges, non inertial reference frames, etc). Weight will be proportional to mass.
- Displacement in a liquid.
Suppose you have a boat floating in a tub, and the tub is filled to the brim with water. If you place an object in the boat (such that the boat is still floating), it will push some water out of the tub because of displacement. The amount of water pushed out weighs exactly the same as the mass in the boat.
I think that both of these methods can easily be adopted in a 2D environment, as long as the environment isn't like the classical "top down" Flatland environment.