Quasi-two-dimensional magnetism in Ru and Rh metal layers sandwiched between graphene sheets