How do miners decode the input transaction? When a transaction is broadcasted to the network, the transaction string contains the little-endian of SHA256(SHA256(X)) where X is the transaction string of input transaction.

Now, since SHA is irreversible, miners will not be able to get the full transaction string (X). So, how do miners verify the authencity of the input? How do they know that the mentioned input transaction actually had 'n' outputs? I am looking to understand the alogirthm behind this.
No, that is not how transactions work.

First of all, transactions are not strings but rather blobs of binary data.

Secondly, the transaction hash that is included in the inputs of a transaction is not an encoding of the previous transaction but rather an identifier. Since sha256d is a secure hash (meaning that there will be a unique hash for basically all inputs), each sha256d hash uniquely identifies the transaction which it is the hash of. This is why transaction hashes are referred to as transaction ids (txids). A node, when it indexes the blockchain, can store in its database the transaction id as a key and the transaction itself as the value. This means that once the node needs the previous transaction for an input, it can easily use the given txid to lookup the transaction in its database and pull the necessary data.