The first thing is that the property is not valued at 40 million baht. How the scheme works is that you must first import the equivalent of 40 million baht of foreign currency into Thailand and exchange that into Thai baht. You must then invest that 40 million baht into an approved investment.
Once you have done that you then need to import and exchange more foreign currency to pay for the land purchase, which could be of any value.
In terms of inheritance, this land would be dealt with in the same way that you mentioned, in that it could not be inherited by any non-Thai who did not qualify as a purchaser themselves. This means that in all likelihood, the land would have to be sold or bequeathed to a Thai citizen.