We are considering the train option from Dublin to Edinburg, does the train involve a ferry.
Yes, there are no bridges or tunnels across the Irish sea.
See this thread from last week- https://community.ricksteves.com/travel-forum/transportation/best-way-to-get-from-dublin-to-edinburgh
What wasn't said is that you need to buy a Rail-Sail ticket if doing the ferry/train option- that is by a long way the cheapest and most flexible surface transport fare option.
Edinburg? No such place it's Edinburgh 😂😂😂 and no there are no bridges or tunnels between the island of Ireland and Great Britain (England Wales Scotland) you'll have fly or take a Ferry from Northern Ireland (part of the United Kingdom)