The air in the bag will be compressed when a weight is placed on the bag. The change of air pressure in the bag will change according to the bulk modulus of the fluid (air in this case) in the bag.
The equation for bulk modulus is as follows:
$$B=-\frac{\Delta p}{\Delta V/V}$$
In this case, $B$ is the bulk modulus of air, $\Delta p$ is the change of the air pressure inside the bag, and $V$ is the initial volume of the bag (before the weight was placed on the bag)
There are multiple ways to approximate the weight of the object on top of the bag. The choice of method to find the weight of the object depends on the information available. If we know $B$, $\Delta V$ and $V$, we could simply calculate $\Delta p$ by rearranging the equation for bulk modulus into $\Delta p = - B \frac{V}{\Delta V}$.
Now, let's consider two cases.
In the first case, the airtight bag is floating in the air. If the weight of the object is nonzero, the bag will accelerate downwards. If the density of the air inside the bag is equal to the density of the air outside the bag, the buoyant force acting upon the bag is zero because $F_B=\rho_{airoutsidebag} V_{bag}g$ (Archimedes' principle), and the weight of the bag is $F_g=m_{bag}g=\rho_{air in bag} V g$ since $\text{density}=\frac{\text{mass}}{\text{volume}} \rightarrow \rho = \frac{m}{V} \rightarrow m=\rho V$ where $\rho$ is density, $V$ is volume and $g$ is the acceleration due to gravity. (We assume that the bag is massless). Basically, in this case we would need very complex formulae and computations to calculate the flow of fluid around the bag since that would affect how much the bag compresses.
In the second case, the airtight bag is on the ground (or on some stationary, rigid object). For simplicity, assume that the airtight bag is actually a piston, and that the weight of the object on the airtight bag is the weight of the piston:
In this case, we can easily calculate the weight of the piston by the change of the volume of air in the system.
Let's say that the bottom of the piston has area $A$. Let $F_{air}$ be the force acting on the piston by the compressed air: $F_{air}=PA$. Let's assume that the piston system thing are just cuboids.Therefore, the initial volume of the air is $V_i=A h_i$ and the final volume of the air is $V_f=A h_f$. This gives us $\Delta V = V_f - V_i = A(h_f - h_i)$. Also, note that by definition, $V=V_i=a h_i$. Since $\Delta p = P_{atm}-P_{final}$, note that $\Delta p$ corresponds to the difference between the pressure inside and outside the piston system. Thus, $$F_{air}=A \Delta p=-AB \frac{v}{\Delta V}=-AB \frac{A h_i}{A (h_f - h_i)}=AB \frac{h_i}{h_i - h_f}$$
At equilibrium, there is no acceleration. Thus, $F_{up}$ is equal to the weight of the object on the airtight bag, which I refer to as $F_g$. In other words, $F_{up}=F_g$, giving us a formula for the weight of the object:
$$F_g=AB \frac{h_i}{h_i - h_f}$$
Notice how I had to make so many simplifying assumptions in order to make the calculations simple. If we used complex shapes, in other words if we tried to compute the weight of the object in a more realistic situation, we would need very complex fluid dynamics calculations which depend on many factors, such as the material used to make the airtight bag and the viscosity of the air.