Hello.
Unfortunately, when you enable ESCI module, this pins Tx and Rx can not be used like general IO pins, even if Rx and Tx are disabled. the next text was taked from datasheet.
13.7.1 ESCI Transmit Data (TxD)
The TxD pin is the serial data output from the ESCI transmitter. When the ESCI is enabled, the TxD pin
becomes an output.
13.7.2 ESCI Receive Data (RxD)
The RxD pin is the serial data input to the ESCI receiver. When the ESCI is enabled, the RxD pin becomes
an input.
The only way to do this, is disable ESCI module, and then you can control this pin.
Regards