Yes the treasury can determine whether the gold bar is really weighing 500 ounces.
We can use the equation:
7 x + 11 y = 500
where x is the amount of the 7 ounce weights while y is the amount of 11 ounce weights.
We know that x and y should be whole numbers therefore this is solved through trial and error.
By trial and error I got:
x = 7 and y = 41
So that;
7 * 7 + 11 * 41 = 500
49 + 451 = 500
500 = 500
Hence they can use 41 11-ounce weights and 7 7-ounce weights to test