I suggest that if this is only needed in one place then what you have now is reasonably clear and should be kept.
If you are doing this a lot then do something like:
public static BranchInfo BranchOrServiceParent(
this IEnumerable<BranchInfo> input)
{
var t = BranchInfos.Single(p => p.BranchID == branchId);
if (t.Type == BranchType.Service.ToString())
t = input.BranchInfos.Single(p => p.BranchID == t.Parent);
return t;
}
Then using it is as simple as:
int branchId = 21;
var t = ctx.BranchInfos.BranchOrServiceParent();
If you subsequently need to parameterize/change thing things you can in a clear fashion.
If you subsequently find that the two possible trips to the database are a performance issue then you can either try a complex Linq query or accept that this probably needs to actually be done by a stored procedure.