In a trigger we cannot get parent record or child record values using __r notation.
The work around for this is we have to get the parent records or child records using the trigger.newMap.keySet().
Sample Code:
List<ParentObject> List = [SELECT Name, Id FROM ChildRecord WHERE ParentObject__c IN : trigger.newMap.keySet();