As per section 195 of the Income Tax Act, it is the responsibility of the person making payment to the NRI to deduct TDS before crediting the proceeds to the NRI account.
Generally, TDS is deducted by the bank with whom the NRI has opened the PIS account for trading before crediting the sale proceeds to the account. However, if the NRI is trading through the Non-PIS NRO account, it is the responsibility of the broker to calculate and deduct TDS before crediting the sales proceeds to NRI.