A couple of thoughts that may help you.
By indirect contact I suspect you mean shock other than by direct contact with an active conductor. This form of shock will occur should somebody contact the motor earthed metal and true earth simultaneously with an earth fault occurring. The 51G relay will pick up the earth fault but not the indirect human contact. The danger comes when the fault current flowing raises the potential of the motor frame above true earth (EPR) and this then forces a current through a person in contact with the metal and true earth. The way to guard against this is to limit that EPR potential and/or the fault clearance time to levels regarded as non-injurious. Guidance on the allowable levels can be found in most HV standards. (Try AS2007 or IEEE80).
A second point is that you state that the transformer neutral and motor frame are connected to independent earth electrodes. This means that the fault path is via those electrodes and the earth. The electrode to earth connection can have a significant resistance and the higher this is the greater will be the generated step and touch potentials which effect the severity of indirect shock. Also, the higher it is, the lower the fault current will be and this may effect the clearance time of the relay. Unless there is a very good reason for having independent earths, I suggest that it would be better to equi-potentially bond the motor case with the transformer neutral grounding conductor, thus creating a low impedance path for the earth fault current which will minimise EPR and the clearance time. This could be done with the earth screen in the cable (if it has one) or a separate earthing conductor.
You could not practrically set 30ma at 20msec as a trip threshold on the 51G relay (It is an earth fault relay not an earth leakage relay) as there will be a small amount of leakage current in the motor to ground during starting. You would probably trip every time you tried to start the motor if you did select such a low threshold.
Hope that this helps.