The best indication of gender is how the two fish react with each other. If you had two males, they would be at one another continually. Two females might tolerate each other, though sometimes not. A male/female duo might or might not get along.
The fish in the cup is severely stressed, which is why it has darkened like it has. Please don't subject fish to this kind of stress for no real reason, it just isn't worth it, and the damage can be permanent depending upon the severity. Chasing fish with a net is tantamount to being pursued by a deadly enemy, and the fish will react severely.