A proper approach to a question is obtained by first analyzing the question properly. Let us do it first.
A program takes as input a balanced binary search tree with $n$ leaf nodes and computes the value of a function $g(x)$ for each node $x$. If the cost of computing $g(x)$ is:
$$\text{min(number of leaf-nodes in left-subtree of x,number of leaf-nodes in right-subtree of x)}$$
Then the worst case time complexity of the program is?
Here it is already given that the function $g(x)$ has cost which is equal to the minimum of the no. of leaves in its left subtree or right subtree. So there is no question of finding the no. of leaves in the left and right subtree of the nodes $x$ given as input to function $g$.
Possibly $g$ is a helper function in a program and as per implementation, the nodes in the balanced binary search tree are already pre-processed (probably) and $g$ probably uses that information and does what it has do to.
Now in the question it is asked to find the worst-case time complexity of the program. Now the program accepts balanced binary search trees. But the worst case behavior is exhibited when the input given to the program is a complete binary tree with $n$ leaf nodes as shown in the picture below:
In the picture above the last level has $n$ leaves.
In level $0$ we have $1$ nodes.
In level $1$ we have $2^1$ node.
…
In level $h$ we have $2^h$ nodes.
So $2^h=n \implies h=\lg n$
Each of the nodes at level $h-1$ has $1$ leaf node in the left as well as right subtree. So for each node cost is hence $1$.
Each of the nodes at level $h-2$ has $2$ leaf node in the left as well as right subtree. So for each node cost is hence $2$.
Generalizing, Each of the nodes at level $h-i$ has $2^{i-1}$ leaf node in the left as well as right subtree. So for each node cost is hence $2^{i-1}$.
Now each level $l$ has $2^l$ nodes. Also $l=h-(h-l)$ so cost for each node at level $l$ is $2^{h-l-1}$ from the previous generalization. Hence we have total cost:
$$\text{Cost =} \sum_{l=0}^{h-1} 2^l \times 2^{h-l-1}=\sum_{l=0}^{h-1} 2^{h-1}=(h)(2^{h-1})=(\lg n )\frac{n}{2}=\Theta(n \lg n)$$
Answer : (B)