So I'm planning a hitchhiking trip and I wounder if there is any chance to get a job on a cargo ship in Portugal and work there till I get to USA (in order to get there without spending any money on tickets). I speak a little bit Portuguese as well.
Do you have a valid work visa for Portugal?
Do you have any qualifications to work on a freighter? Ordinary / Able Seaman? Deckhand? Cook (with ship experience - it's not a hotel)?
Given that you asked here, I would guess no.
You can try the larger ports, but the days of just walking up to a ship and getting a short-term job are ling gone. Have Plan B ready before your visa expires.