Height of a random forest decison tree increasing till 25 and the test accuracy also increases
This is extremely dependent on the dataset at hand. For such a small dataset tree depth of 25 is indeed on the high side and I would say somewhat unusual. But it is not impossible. What it can depend on:

relation between features and the target
categorical vs numerical features
imbalance of 0 vs 1 target
your code implementation (bugs, data leakage, other parameters)

If I were you i would look deeper to understand why such a deep tree is required. For example, you can start by identifying while feature gets the most splits: extract from the best model feature importances with type split and get the top-5 features. Look how do those correlate with the target.
I have a dataset of [~16k] and am doing binary classsfication [0/1].When i am doing hyperparameter grid search in random forest my train and test accuracy increase as increase the depth[optimum is coming out to be 25].I am getting a test accuracy of as high as 97% and no there is no data leakage as there are three sets [train,test,and valid].My data has ~10 features.Is this fine since usually i have seen trees have 10 depth at max.