Sort and merge list based on another list
Very poor problem statement.  Problem statement is based on your perceived solution so review is difficult.  I could only figure out what you are trying to do by reviewing the code.  

Why long Id? If you have that many OnGoingProcess then will probably need a different approach.

Have proper constructors for OnGoingProcess and make Id read only.  

Create a proper application and test.  Don't just jam everything in Main.

You are changing selectedDetails.   A calling procedure does not want an input changed.   Output a new List mergedDetails.

Proper problem statement
processDetails and sortedPlans are each List of OnGoingProcess identified by property Id
Need output in this order    


processDetails not present in sortedPlans (in the order in    processDetails)
sortedPlans (in the order of sortedPlans)
if present in processDetails then processDetails
else then sorted plan  


Putting those thoughts in action 

public static void OnGoingProcessMergeTest()
{
    var processDetails = new List&lt;OnGoingProcess&gt;()
    { new OnGoingProcess(120, "Process 29", "T20"), new OnGoingProcess(100, "Process 2", "A20"), new OnGoingProcess(99, "Process 3", "S20"),
      new OnGoingProcess(85, "Process 229", "B20"), new OnGoingProcess(220, "Process 39", "C20"), new OnGoingProcess(15, "Process 20", "D20"),
      new OnGoingProcess(101, "Process 129", "G20")};

    var routePlans = new List&lt;OnGoingProcess&gt;()
    { new OnGoingProcess(100, "Process 2"), new OnGoingProcess(120,"Process 29"), new OnGoingProcess(222, "Process new"),
      new OnGoingProcess(85, "Process 229"), new OnGoingProcess(101, "Process 129")};

    List&lt;OnGoingProcess&gt; mergedDetails = OnGoingProcessMerge2(processDetails, routePlans);
    foreach (var sorted in mergedDetails)
    {
        Debug.WriteLine("Id : " + sorted.Id + " Name : " + sorted.Name + " Code : " + sorted.Code);
    }
    Debug.WriteLine("");
}       
public static List&lt;OnGoingProcess&gt; OnGoingProcessMerge2(List&lt;OnGoingProcess&gt; processDetails, List&lt;OnGoingProcess&gt; routePlans)
{
    List&lt;OnGoingProcess&gt; onGoingProcessMerge = processDetails.Where(x =&gt; !(routePlans.Any(y =&gt; y.Id == x.Id))).ToList();
    foreach(OnGoingProcess routePlan in routePlans)
    {
        OnGoingProcess processDetail = processDetails.FirstOrDefault(x =&gt; x.Id == routePlan.Id);
        onGoingProcessMerge.Add(processDetail ?? routePlan);
    }
    return onGoingProcessMerge;
}