How to compare several distances?

Hey, thank you for reading through here!

So, I try to say it as short as possible; I’ve made good progress in my 2D Grand Strategy game, but don’t know how I should make the AI. Well, I technically know what I want and how it would work, but I don’t know how it is coded. Basically, a Physics2D.OverlapCircle is detecting which provinces are around an unit for the unit to find it’s path to the target province which is in the contested zone.

I thought that for the pathfinding the unit will see which provinces are around it and then compare the distance of each of them to the target province. It moves to the one with the shortest distance then and repeats this process every turn to eventually arrive in the target province.

Now, how can I get the distances for for example four provinces to the target province and compare each of the distances to get the smallest one? Or, asked differently, how can I use Vector2.Distance for several inputs and seperate them to compare them and find the shortest one?

Code for getting the object inside the circle:
    Collider2D[] borderingProvinces = Physics2D.OverlapCircleAll(transform.position, 10);
                foreach (Collider2D hit in borderingProvinces)
                {
                    if (hit.tag == "Province")
                    {
                        // here comparing to other provinces!
                    }
                    else if (hit.tag == "playerProvince")
                    {
                        Debug.Log("Player's Province spotted!");
                        transform.position = hit.transform.position;
                    }
                    else
                    {
                        Debug.Log("Error!");
                    }
                }

The basic solution for this problem will be something like:

Transform FindClosest()
{
    // Code for getting the object inside the circle:
    Collider2D[] borderingProvinces = Physics2D.OverlapCircleAll(transform.position, 10);

    // Start with an impossibly high distance for comparison
    float closestDistance = 99999;
    Transform closest = null;

    foreach (Collider2D hit in borderingProvinces)
    {
        if (hit.tag == "Province")
        {
            var distance = (transform.position - hit.transform.position).magnitude;
            if (distance < closestDistance)
            {
                closest = hit.transform;
                closestDistance = distance;
            }
        }
        else if (hit.tag == "playerProvince")
        {
            Debug.Log("Player's Province spotted!");
            transform.position = hit.transform.position;
        }
    }

    return closest;
}

You can simplify this a bit with something like Linq, though. I’m not counting this as an answer as I don’t really understand the question. Are these distances really the only thing determining your pathfinding? Even though this does get the “closest” of your provinces, that might be irrelevant from a full path you’re trying to derive.