Yes I think you are right to be worried. I understand that you have a 4 gallon tank. The usual stocking rule is one inch per gallon for slimbodied fish.
Now pentazona barbs grow to 3.5 inches, so 3 of those would make 11.5 inches.
If you have platies that would be 3x2 inches = 6 inches. If swordtails 3x4 inches= 12 inches.
So either you are overstocked by 11.5+6=17.5= just over 300%, or if you have swordtails 11.5+12=23.5= nearly 500%.
Incidentally, you should NEVER buy a fish (or accept it as a gift) without knowing what it is, as different fish have different requirements. Swordtails are strong fast swimmers who need good-sized tanks (at least 20 gallons). And by the way, I would not be happy if my platies spent all their time hanging at the surface. They are surface-feeders, but they are also very inquisitive creatures who like exploring when in good health.
It looks to me like you have 3 options:
a) take those fish back to the shop and get a betta, the only fish who will be happy in such a small tank
B) upgrade quickly to a much larger tank and be prepared to work very hard with water changes while the new tank is cycling
c) prepare to bury your fish
I wish I could be more helpful, this is very negative, but it is difficult to offer anything better under the circumstances. Of course, I may have misunderstood your posts and these fish may in fact be in a much larger tank. In that case, please ignore all the above and just post us your water stats and size of your tank and we will take it from there.