Create a view that shows a list of templates.
Add a relationship to the actions content type (Entity Reference: Referenced Entity via field_related_action).
Add a relationship to the files content type (join type referencingEntity Reference: Referencing entity via field_related_action).
Create a contextual filter based on the current nodes nid. When you create the filter then When the filter value is NOT available select Provide default value and choose content ID from URL. Also this filter should be for the second join to the file node type.
Set that view to show in a block on each files page.