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.
You'll see several agencies offering you cargo ship trips, but they mostly look scammy.
For cargo ships it is cumbersome to take tourists. They would have to feed them, include a doctor (if there are more than 12 pax on board), give them some safety instructors, evacuate them in case of fire/accidents, make sure they are not terrorists, and so on.
For tourists to travel by cargo ship is not very convenient. There are very probably no tasks to assign to them, so, they'd also charge $100/day. There won't be any amenities on board, so it will be boring.
If you want to work on a ship, it's much more probable that you get hired by a cruise. They need literally thousands of employees and have all sorts of jobs. There are cruise ships that cross the Atlantic, so it's a matter of research into companies and hiring procedures.