Once the property was inherited by the foreigner, it becomes his own and absolute property, he can sell or can transfer it by a gift deed to any person of his choice, there is no illegality in it neither he requires permission from RBI for doing this act nor the RBI has any restriction towards such transfer of immovable property.
Now the resident Indian has sold the property to a third person by a registered sale deed, which is normal course of a legal transaction and until and unless somebody plays a fraud in this, then there is n legal infirmity in this transaction too.
As far as the money transferred to foreign country, it is a different subject. According to the Reserve Bank of India (RBI), Indian citizens can transfer up to $250,000 per financial year to a foreign account under the Liberalised Remittance Scheme (LRS). This limit applies to all resident individuals, including minors.
Thus there is no illegality is observed as per your contents in any of the said transactions.