In the actual raw transaction, the input contains either the 'scriptSig' and/or 'Witness' which could contain the 'pubKey' or 'redeemScript' depending on the script type. (aside from the signature)
Basically, a script that solves the scriptPubKey, but not the scriptPubKey itself.
For reference check the structure of a raw transaction here: https://learnmeabitcoin.com/technical/transaction-data
In the "Input(s)", there's no "scriptPubKey".
But how can they derive the address from those info?
Since it contains the pubKey or RedeemScript, they can easily derive the appropriate address type from it.
The script type is based from the scriptSig or Witness which is different per script type.
Or just base it from the parent transaction's output script. (methods to get the input's address mostly depends on their parser)