Transients are stored as options in the wp_options table (in most cases).
All option values are always converted to strings when stored. The table that holds them has the option_value column defined as longtext, and the option functions escape to string values when creating the SQL. Thus, bare integers will be converted to strings.
Since PHP is a loosely typed language, strings that are integers will be autoconverted when they are later used as integers, so this is not usually a problem.
Also note that any values which don’t convert cleanly to string (like arrays, or objects) will be automatically serialized and unserialized when going to/from the database. The underlying WordPress option functions handle this for you, so it’s not necessary to do it yourself. You can send an array or object to the transient functions and get the same thing back from them.
Post meta behaves in the same fashion, but in your code, when you get from the post_meta, you’re running intval across the string, which is why you get back an integer.