Im running 2-240v 40 amp circuits to feed 3 receptacles.
They have to be 50A receptacles.
And there can only be one of them per circuit. I gather that's not going to work for your requirement. Then you need to do something else.
This is to run 2 UV lights and one small conveyor belt. The UV lights are each pulling 14 amps and the conveyor 10 amps. I plan on pig tailing one circuit to 2 receptacles for the lights and the other circuit for the conveyor.
OK, you generally can't dogpile a bunch of <16A loads onto a single 40A circuit. In a commercial application you can sometimes do this with lighting using the Tap Rules, but the loads must be hardwired.
What you can do is install a subpanel out at the remote location, and then have 15/20A breakers in the sub feeding the various loads. Get a big sub; remember your 240V loads will gobble 2 spaces each. You do not need to run a neutral wire if all the subpanel loads are 240V, but you might be glad you did.
Im wondering if I can use 10/4 cable using black and white (white marked as hot of course) for one circuit and red and blue for the other circuit.
#10 wire is a no-go on a 40A circuit because of NEC 240.4(D). You must use #8 (Cu or Al).
Can I use the same ground wire for both circuits?
Yes, if you solve the other problems.
Most commercial installations require conduit anyway.
If you run EMT metal conduit, that is your ground, and you can run anything you please in the pipe, up to 4 single-phase circuits.