Slice the hoagie rolls 3/4 of the way through with a serrated knife. Dice the onions and thinly slice the beef.
In a small bowl, mix 2 Tbsp softened butter with 1 pressed garlic clove. Spread the garlic butter onto the cut sides of the hoagie rolls. Toast the buns on a skillet or griddle until golden brown, then set aside.
In the same skillet, sauté the diced onions until caramelized, then transfer to a bowl.
Increase the heat to high and add 1 Tbsp oil. Spread the thinly sliced steak in an even layer. Let it brown for a couple of minutes undisturbed, then flip and season with salt and pepper. Saute until fully cooked through, then stir in the caramelized onions.
Divide the steak and onion mixture into 4 portions and top each with 2 slices of cheese. Turn off the heat so the cheese melts without overcooking the meat.
Spread a thin layer of mayo on the toasted side of each roll. Working with one portion at a time, place a toasted bun over each portion and use a spatula to scrape the cheesy beef into your bun as you flip it over. Serve warm.