Variables of a transaction are of local scope (they can be used only inside the transaction) but have a global life span (they are created at the beginning of a simulation and are destroyed at the end of the simulation; compare defining a static variable in a C function). Therefore transaction variables are initialized once and can hold their values over multiple calls of the transaction. Global variables are of global scope and global life span.
Random variables are of global scope (they can be used in any transaction, SQL command or workload description). The value of a random variable is refreshed each time the variable is used.