X-ray emission mechanisms in protostellar jets