@Avinash.Haridasu Tree table loads the content inside the tree dynamically on expand (defer load) - as such when expending a nodes, the inner row will automatically have the expand icon render - if there is nothing to expand, clicking on the icon will results in a no-op and the expand icon will be removed.
If you switch to the legacy tree grid, it is possible to control if the expand icon should be rendered. You can use an expression or a when rule if you need a more complex logic (using a RUF).
If you are using an optimized tree grid - this functionality is not present -It is possible to achieve this functionality is you know that the tree grid has a constant depth for all the parent leafs by using CSS to hide the expand collapse button.
Each level has the aria-level present in the DOM -
you can easily hide the expand icon. Here is an example of selector that will hide the expand icon on the 2nd level