Just to elaborate on Mahesh's answer.
Transactions can't be cancelled or marked as failed. Once you submit a transaction to the network there is no way to cancel it.
The only thing you can do it overwrite the transaction. Note that this is just a trick and in reality it just means that you send another transaction to the network with the same nonce. If the ...
You can drop/reject transactions using Ethereal with an automated python script that encounters on every 5 seconds.
To understand more about Ethereal, Go through below link :
Releasing Stuck Ethereum Transactions
Hope this answer will help You.