They do get an attorney when they needed. There are various procedures for that, but it depends on nature of the crime. If it is too nasty then they are treated differently. You can read more here about the rights of criminals and how the judgment is taken.