The solution uses the fact that an inorder traversal of a BST produces elements in a nondecreasing order.
low holds the value of the last accessed element.
count_temp holds the number of occurrences of the current element.
count holds the number of occurrences of the mode element(s).
Two possibilities arise when traversing the tree:

Current element is different from the previous element. If this is true:
reset the count_temp,
reassign low and if count is 1,
add the current element to the list. 
Current element is the same as the previous element. If this is true:
increment the count_temp;
if count_temp exceeds the count, refresh the list, add the current element; update count.
else, add the current element without refreshing the list.
int low = Integer.MIN_VALUE, count = 1, count_temp = 0;
List<Integer> list = new ArrayList<>();
public int[] findMode(TreeNode root) {
mode(root);
int result[] = new int[list.size()];
for(int i=0; i < list.size(); i++)
result[i] = list.get(i);
return result;
}
public void mode(TreeNode root){
if(root != null){
mode(root.left);
if(root.val != low){
count_temp = 1;
low = root.val;
if(count == 1) list.add(root.val);
}
else{
count_temp++;
if(count_temp > count){
list = new ArrayList<>(Arrays.asList(root.val));
count = count_temp;
}
else if(count_temp == count) list.add(root.val);
}
mode(root.right);
}
}