Checking for files that are mentioned as children of other files
General Remarks

Why are your files assigned to properties of an object? Keeping them in an array would be simpler. Or do you wish to store some kind of mapping from id → file? You currently use the file's name as a unique id which would then redundantly appear on both sides of that mapping.

Matching only by file name seems risky to me, but it really depends on your definition of 'child'. Depending on the exact use case, a file path plus name or a file hash value might be a more suitable unique identifier.

I would avoid talking about 'class structure' when describing the structure of anonymous objects. 'class' has a specific meaning, especially since the class keyword has been introduced to JavaScript now. If your files were really instances of a class, you would probably want to use some kind of creational design pattern such as a factory or factory method which avoids the issue of having to deal with incompletely initialized instances until you finally fill in the parents.


Style

The first code sample could be more readable if it weren't squeezed into a single line.

All code samples could benefit from better naming. Instead of file write child, instead of fileInner write parent, instead of curFileName write child.name etc.

Instead of indexOf use includes. Since you already use const, you should also use let instead of var or globals.

Instead of Object.keys use Object.values.


Your first or second example could be written as:
files.forEach(parent =&gt; {
  files.forEach(child =&gt; {
    if (parent.children.includes(child.name)) {
      child.parents.push(parent.name);
    }
  });
})

Alternatively using for-of-loops:
for (const child of files) {
  for (const parent of files) {
    if (parent.children.includes(child.name)) {
      child.parents.push(parent.name);
    }
  }
}

If files is not an array but an object, replace files with Object.values(files).
Performance
If performance is really an issue, look into the runtime complexity of your operations. By introducing an explicit Map from parent names to children files, the runtime complexity could be reduced to depend linearly on the total number of children only.