You can use the Runs Query Api as Matt mentioned. However i found the buildId query parameter didnot work probably. You may need to filter the api results by the buildId. See below example:
$connectionToken="Personal Access Token"
$base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($connectionToken)"))
$url = "https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate=2020-10-20&maxLastUpdatedDate=2020-10-22&api-version=6.0"
$results= Invoke-RestMethod -Uri $trurl -Headers @{authorization = "Basic $base64AuthInfo"} -Method Get
$run = $results.value | Where-Object{$_.buildConfiguration.id -eq $buildId}
$runId = $run.id
You can also check out Runs List Api. I found the buildId was always appended to the run title. You can filter api results by the run name. See below:

$connectionToken="Personal Access Token"
$base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($connectionToken)"))
$url = "https://dev.azure.com/{organization}/{project}/_apis/test/runs?api-version=6.0"
$results= Invoke-RestMethod -Uri $trurl -Headers @{authorization = "Basic $base64AuthInfo"} -Method Get
$run = $results.value | Where-Object{$_.name -match $buildId}
$runId = $run.id