You can not compare them like that unless they are from the same issuer and they are issued under the same legal system. All things being equal, a short term bond will have lower risk because the risk of default increases as the maturity is further in the future because of the uncertainty that the longer maturity brings.
However, you can have a less risky long term investment issued by country A for example when compared with a short term bond issued by country B.