Very normal for platies to do this, they establish a pecking order, like many fish.
Welcome to the hobby! I'm afraid the big brand stores tend to give terrible advice to new hobbyists, and then they end with incompatable fish in too small a tank, water conditions get bad, fish die, person leaves the hobby feeling like they've failed
I would love to help you sort this out, so you can have a successful tank, with happy fish! The most urgent thing is, has the tank been cycled in any way? Does it have a filter? How long was it set up before adding the fish?
A five gallon really is too small for platies, and while I'm glad you don't have any females (they produce a LOT of babies very fast, and overcrowd the tank in no time!) and male only platy tanks can work as well... two of them isn't a great number, because as you've seen, one dominates the other. I currently have three male platies together, with other fish, but no females and only the three males. They spar a bit now and then, which consists of displaying to each other and the odd bit of chasing, but since it's divided between the three of them, and it's a 57g tank with lots of plant matter for them to avoid each other, it's not a problem.
So the solutions are either to get another tank and more platies (I'd suggest 5-6 males only in a 20g tank) and carefully introduce them, monitoring them for bullying behaviour and potentially having to remove troublemakers, while also having plenty of tank decor and either real or fake plants, or, and this is probably the better suggestion;
Return the platies, keep the 5 gallon, and get a betta fish instead. They're happy to live alone in a 5 gallon, and they need to be alone - they're not called the Siamese Fighting fish for nothing! They're a solitary species. But pretty good fish for beginners, much easier to care for, and you can hand feed them
I haven't kept them myself, but people say they have a real personality, like a wet pet