Actually, it's a complicated answer. Generally, in the days before deregulation in 1980, all railroads agreed on rates, routings, and other such matters. Price-fixing was legal for the railroads, and rates between any two given points were generally the same for all lines. Competition was more on the basis of service and car supply. So in that sense B&O and PRR worked together, albeit uncomfortably (mostly uncomfortably for the B&O, since the Pennsy dominated Eastern ratemaking policy).
The question of interchange at Philadelphia is something else, however. Generally, all points east of Pittsburgh and Buffalo were considered "closed terminals," meaning that there was no reciprocal switching to reach industrial customers. (Reciprocal switching means that railroad "A" will switch cars from railroad "B" to and from customers on "A" for a charge, and "B" does likewise for "A".) That meant that in Philly, a customer on, say, the PRR was exclusively tied to the Pennsy -- B&O couldn't serve him by any means. The only exceptions were special agreements between the railroads for certain customers, and that may or may not have been so in the area you mention -- I don't know, but probably unlikely.
As anyone in Philly knows, B&O originally had a very limited number of on-line customers there, since it was confined almost entirely to South Phila. Before the early 1960s, most of its Philly (and eastern PA) business came from the Reading via the Rutherford-Hagerstown-Cherry Run route. About 1963 or '64 it made a special agreement with the Reading to get this business via the Park Jct. gateway, and that lasted until Conrail's takeover of the Reading eventually killed it off.
More than you wanted to know, but that's what you get for asking.