Canadian Pacific Kansas City's profit and revenue edged up in the fourth quarter as it finished its first full year as a merged company and dealt with a year-long labor dispute.