Guide:
Let $B$ denotes the event that the metal detector beeps.
Let $T$ denote the event that there is treassure.
Now apply Bayes rule on $P(T|B)=\frac{P(T)P(B|T)}{P(B)}=\frac{P(T)P(B|T)}{P(T)P(B|T)+P(T^c)P(B|T^c)}$.
You will have to make some assumption, such as the treassure only appears in exactly one of the squares.