How can I automatically make term relations between all the terms with same term name?
I don't think you really want to just display the related terms. Thats a complicated band-aid to a problem you probably would be better off actually solving.
This type of problematic data is often encountered as part of a migration so it is definitely do-able in a migration like process.
Steps:

Decide which tid is going to be authoritative.
Find all duplicates of that term.
Re-assign all references to that duplicate term to the
authoritative term.

Install the Taxonomy dupecheck module so you don't get in this kind of trouble again. Some details from its project page:

Taxonomy dupecheck module prevents Drupal administrators from adding duplicate taxonomy vocabularies and/or terms. It's helpful when entering large amounts of terms or vocabularies in situations where each value must be unique. This saves time by preventing administrators from having to enforce a unique value policy through later cleanup of duplicate terms.
The module provides a configuration screen allowing administrators to choose which should be unique: taxonomy terms, vocabularies or both. It defaults to case-insensitive comparisons, with an option to change to case-sensitive. Both stored and input terms/vocabularies are trimmed before comparison to handle cases such as 'foo ' and 'foo'. Based on the settings, the user will see an error message when adding a duplicate value.
Caveat: due to the inability of hook_taxonomy_term_presave() to stop the saving process, this only works in the taxonomy term and vocabulary forms. If you want to prevent duplicates through other entry points, this module will not prevent that. If someone knows a way around that I will happily add that in, as that was the original plan.