Either city will give you art, food and nightlife. Speaking as a life-long Torontonian, I think Montreal is the more fun city to visit, especially for a solo traveler your age. The nightlife is more vibrant, the architecture is older and more interesting, the social atmosphere is more outgoing and spontaneous, and the food scene includes more of a unique local cuisine (although both cities, probably Toronto especially, also have an excellent international food scene).
I agree that the train ride between the cities is nothing special scenery-wise, mostly farmland and the *occasional* Lake Ontario/St. Lawrence River view.
As for hiking, you'd need to get out of the cities for that and you'd need to go by car. Yes Montreal has Mount Royal which is a very nice place to go for a vigorous walk to an impressive viewpoint, and Toronto has various ravines and greenspaces, but these are still urban parks, not wildland hiking trails. If you rented a car even for a day in either city you could get to decent hiking in an hour's drive. But if hiking is a serious priority you should skip one of the cities, and divide your time between the other city and somewhere a few hours north of it that you'll drive to as a base for hiking in a more natural area.
And if you're looking for the most economical way to get between Toronto and Montreal, it's probably shopping for an informal rideshare, like on craigslist -- here are the listings for rides out of Toronto, and you'll see many if not most are to Montreal: https://toronto.craigslist.ca/d/rideshare/search/rid