In minecarts, you can use hoppers to travel upward, but it is not possible to connect only hoppers and travel upward. A separate device from hoppers is an item elevator, which can be constructed from blocks, water, and fence posts.