This distance will be infinite whenever either of the distributions is singular with respect to the other. This means the only cases where it will not be infinite are where the distributions have a common support, which will necessarily be an affine subspace of $\mathbb{R}^d$ on which both $\mu_1$ and $\mu_2$ lie. When that is a proper subspace, all three determinants $|\Sigma|,$ $|\Sigma_1|,$ and $|\Sigma_2|$ will be zero.
The key is to find this common subspace. It will lie within the span of $\Sigma.$ Writing its Singular Value Decomposition
$$\Sigma = U D V^\prime$$
for orthogonal matrices $U$ and $V$ and diagonal matrix $D$ with positive elements (the singular values),
Identify the singular values that are essentially zero (compared to the others up to the precision of your arithmetic).
Set $U^{*}$ to be the matrix formed by columns of $U$ corresponding to the nonzero singular values, $D^{*}$ to be the diagonal matrix of nonzero singular values, and $V^{*}$ to be the matrix formed by the corresponding columns of $V$.
Change the basis in which all three matrices are represented by forming $$\Sigma_i^{*} = {U^{*}}^\prime \Sigma_i V^{*}.$$
In this basis, $\Sigma = D^{*}$ and so its determinant is the product of the nonzero singular values. Use the determinants of the $\Sigma_i^{*}$ in the Battacharya distance formula.
Of course you need to check that $\mu_1-\mu_2$ lies in the span of $\Sigma.$ That's now easy: all the components of $U^\prime (\mu_1-\mu_2)$ corresponding to the zero singular values must themselves be zero.
To illustrate, here is R
code implementing this strategy. First, though, let me show an example of its use where both distributions are singular but, because they have a common support on the line $y=x+1,$ their distance is not infinite:
distance.Battacharya(c(1,0), c(2,1), matrix(1,2,2), matrix(1,2,2))
[1] 0.125
Here, $\Sigma_1 = \Sigma_2 = \pmatrix{1&1\\1&1}.$
distance.Battacharya <- function(mu1, mu2, Sigma1, Sigma2) {
d <- length(mu1)
if (d != length(mu2)) return(Inf)
Sigma <- (Sigma1 + Sigma2)/2
fit <- svd(Sigma)
i <- zapsmall(fit$d) != 0
#
# Compute the log determinant terms.
#
logdet <- function(X) determinant(t(fit$u[, i]) %*% X %*% fit$v[,i], log=TRUE)$modulus
q <- c(sum(log(fit$d[i])), -logdet(Sigma1)/2, -logdet(Sigma2)/2)
#
# Compute the Mahalanobis distance term.
#
dmu <- mu1 - mu2
if(any(t(fit$u[, !i]) %*% dmu != 0)) return(Inf)
y <- fit$v[,i] %*% diag(1/fit$d[i], sum(i), sum(i)) %*% t(fit$u[, i]) %*% dmu
sum(dmu * y)/8 + sum(q)/2
}