An ordinary rank-two case of local-global compatibility for automorphic representations of arbitrary weight over CM fields